Skip to content

Commit b80b2ad

Browse files
committed
Fix regression introduced by commit 945e928 on multiline comment
1 parent a5ae177 commit b80b2ad

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

lib/Ora2Pg.pm

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13770,6 +13770,9 @@ sub format_data_type
1377013770
} else {
1377113771
$col =~ s/^([\-]*)(\~|Inf)$/$1Infinity/i;
1377213772
}
13773+
}
13774+
else
13775+
{
1377313776
if (!$sprep) {
1377413777
$col = 'NULL' if ($col eq '');
1377513778
} else {
@@ -14563,16 +14566,19 @@ sub _remove_comments
1456314566
{
1456414567
next if ($lines[$i] !~ /\S/);
1456514568

14566-
# Single line comment --...-- */ is replaced by */ only
14567-
$lines[$i] =~ s/^([\t ]*)\-[\-]+\s*\*\//$1\*\//;
14568-
14569-
# Check for -- and */ in the same line
14570-
if ($lines[$i] =~ /(--.*)(\*\/.*)$/)
14569+
if ($lines[$i] !~ /^[\t ]*\--.*\/\*.*\*\/.*$/ and $lines[$i] !~ /\/\*.*\*\/$/)
1457114570
{
14572-
$lines[$i] = $1;
14573-
splice(@lines, $i + 1, 0, $2);
14571+
# Single line comment --...-- */ is replaced by */ only
14572+
$lines[$i] =~ s/^([\t ]*)\-[\-]+\s*\*\//$1\*\//;
14573+
14574+
# Check for -- and */ in the same line
14575+
if ($lines[$i] =~ /(--.*)(\*\/.*)$/)
14576+
{
14577+
$lines[$i] = $1;
14578+
splice(@lines, $i + 1, 0, $2);
14579+
}
1457414580
}
14575-
14581+
1457614582
# Single line comment --
1457714583
if ($lines[$i] =~ s/^([\t ]*\-\-.*)$/$1\%ORA2PG_COMMENT$self->{idxcomment}\%/)
1457814584
{

0 commit comments

Comments
 (0)