Author: adam-guest
Date: 2008-07-07 17:50:57 +0000 (Mon, 07 Jul 2008)
New Revision: 1566

Modified:
   trunk/debian/changelog
   trunk/scripts/checkbashisms.pl
Log:
Don't treat '. "a b"' as a sourced script being passed arguments

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-07-07 17:19:05 UTC (rev 1565)
+++ trunk/debian/changelog      2008-07-07 17:50:57 UTC (rev 1566)
@@ -10,6 +10,7 @@
     + Fix a false-positive in the "source script with arguments check"
     + Treat """" as "" when removing quotes
     + Catch shell script wrappers which use "foo $0 $@ &\nexec true"
+    + Don't treat '. "a b"' as a sourced script being passed arguments
   * debchange: Also collapse UNRELEASED stanzas when -d is used
   * debcheckout:
     + Improve git repository handling with --file

Modified: trunk/scripts/checkbashisms.pl
===================================================================
--- trunk/scripts/checkbashisms.pl      2008-07-07 17:19:05 UTC (rev 1565)
+++ trunk/scripts/checkbashisms.pl      2008-07-07 17:50:57 UTC (rev 1566)
@@ -276,7 +276,10 @@
 
            # since this test is ugly, I have to do it by itself
            # detect source (.) trying to pass args to the command it runs
-           if (not $found and m/^\s*(\.\s+[^\s;\`:]+\s+([^\s;]+))/) {
+           # The first expression weeds out '. "foo bar"'
+           if (not $found and
+               not m/^\s*\.\s+(\"[^\"]+\"|\'[^\']+\')\s*(\&|\||\d?>|<|;|\Z)/
+               and m/^\s*(\.\s+[^\s;\`:]+\s+([^\s;]+))/) {
                if ($2 =~ /^(\&|\||\d?>|<)/) {
                    # everything is ok
                    ;



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

Reply via email to