From: Sandro Santilli Date: Tue, 26 Aug 2014 09:41:08 +0000 (+0000) Subject: Do not skip lines starting with "--" from comments (#2759) X-Git-Tag: 2.2.0rc1~875 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aca3e979374357ef159992c91add3b1d1bfbaab4;p=postgis Do not skip lines starting with "--" from comments (#2759) git-svn-id: http://svn.osgeo.org/postgis/trunk@12918 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/utils/postgis_restore.pl.in b/utils/postgis_restore.pl.in index e074d863f..78e243254 100755 --- a/utils/postgis_restore.pl.in +++ b/utils/postgis_restore.pl.in @@ -277,6 +277,22 @@ while( my $l = ) { next; } + # Parse comments, to avoid skipping quoted comments + # See http://trac.osgeo.org/postgis/ticket/2759 + elsif ( $l =~ /^COMMENT ON .* IS '(.*)/) + { + my @sublines = ($l); + my $comment = $1; + # A comment ends with an odd number of single quotes and a semicolon + while( $comment !~ /('*)[\t ]*;[\t ]*$/ || length($1) % 2 == 0) + { + $comment = ; + push(@sublines, $comment); + } + print STDOUT @sublines; + next; + } + # Clamp SRIDS in spatial_ref_sys elsif ( $l =~ /COPY spatial_ref_sys /) {