Author: adam-guest
Date: 2008-07-07 12:42:11 +0000 (Mon, 07 Jul 2008)
New Revision: 1563

Modified:
   trunk/scripts/checkbashisms.pl
Log:
Revert r1220 - it was only needed due to bugs in order areas of the code

Also stop trying to check comments for quoted strings, as its far too 
prone to FPs


Modified: trunk/scripts/checkbashisms.pl
===================================================================
--- trunk/scripts/checkbashisms.pl      2008-07-06 21:59:31 UTC (rev 1562)
+++ trunk/scripts/checkbashisms.pl      2008-07-07 12:42:11 UTC (rev 1563)
@@ -162,11 +162,17 @@
        }
 
        # We want to remove end-of-line comments, so need to skip
-       # comments in the "quoted" part of a line that starts
-       # in a quoted block or that appear inside balanced pairs
+       # comments that appear inside balanced pairs
        # of single or double quotes
-       s/^(?:.*?[^\\])?$quote_string(.*)$/$1/ if $quote_string ne "";
 
+       # Remove comments in the "quoted" part of a line that starts
+       # in a quoted block? The problem is that we have no idea
+       # whether the program interpreting the block treats the
+       # quote character as part of the comment or as a quote
+       # terminator. We err on the side of caution and assume it
+       # will be treated as part of the comment.
+       # s/^(?:.*?[^\\])?$quote_string(.*)$/$1/ if $quote_string ne "";
+
        next if m,^\s*\#,;  # skip comment lines
 
        s/(^|[^\\](?:\\\\)*)\'(?:\\.|[^\\\'])+\'/$1''/g;
@@ -206,7 +212,7 @@
            if ($quote_string ne "") {
                my $otherquote = ($quote_string eq "\"" ? "\'" : "\"");
                # Inside a quoted block
-               if ($line =~ /(?:^|^.*?[^\\$otherquote])$quote_string(.*)$/) {
+               if ($line =~ /(?:^|^.*?[^\\])$quote_string(.*)$/) {
                    my $rest = $1;
                    my $templine = $line;
 



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to