Author: djpig
Date: 2008-06-17 22:06:53 +0200 (Tue, 17 Jun 2008)
New Revision: 1389

Modified:
   trunk/checks/scripts
   trunk/debian/changelog
Log:
* checks/scripts:
  + Remove "quoted quotes". They're likely to be inside
    another pair of quotes; we're not interested in
    them for their own sake and removing them makes finding
    the limits of the outer pair far easier.  Patch by
    Adam D. Barratt.


Modified: trunk/checks/scripts
===================================================================
--- trunk/checks/scripts        2008-06-16 23:54:48 UTC (rev 1388)
+++ trunk/checks/scripts        2008-06-17 20:06:53 UTC (rev 1389)
@@ -597,7 +597,14 @@
                # argument to grep or the like.
                my $line = $_;
                unless ($found) {
-                   $line =~ s/(^|[^\\](?:\\\\)*)\'(?:\\.|[^\\\'])+\'/$1''/g;
+                   # Remove "quoted quotes". They're likely to be inside
+                   # another pair of quotes; we're not interested in
+                   # them for their own sake and removing them makes finding
+                   # the limits of the outer pair far easier.
+                   $line =~ s/(^|[^\\\'\"])\"\'\"/$1/g;
+                   $line =~ s/(^|[^\\\'\"])\'\"\'/$1/g;
+
+                   $line =~ s/(^|[^\\\"](?:\\\\)*)\'(?:\\.|[^\\\'])+\'/$1''/g;
                    for my $re (@bashism_string_regexs) {
                        if ($line =~ m/($re)/) {
                            $found = 1;
@@ -610,7 +617,7 @@
                # We've checked for all the things we still want to notice in
                # double-quoted strings, so now remove those strings as well.
                unless ($found) {
-                   $line =~ s/(^|[^\\](?:\\\\)*)\"(?:\\.|[^\\\"])+\"/$1""/g;
+                   $line =~ s/(^|[^\\\'](?:\\\\)*)\"(?:\\.|[^\\\"])+\"/$1""/g;
                    for my $re (@bashism_regexs) {
                        if ($line =~ m/($re)/) {
                            $found = 1;

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-06-16 23:54:48 UTC (rev 1388)
+++ trunk/debian/changelog      2008-06-17 20:06:53 UTC (rev 1389)
@@ -11,6 +11,12 @@
       non-obsolete alternatives specified and if the obsolete
       package is not listed first.  Issue an info tag for them
       though.  Patch by Adam D. Barratt.  (Closes: #486145)
+  * checks/scripts:
+    + [FL] Remove "quoted quotes". They're likely to be inside
+      another pair of quotes; we're not interested in
+      them for their own sake and removing them makes finding
+      the limits of the outer pair far easier.  Patch by
+      Adam D. Barratt.
   * checks/watch-file{,.desc}:
      + [FL] Check for more Debian specific strings in version
        number.  Issue an info tag if the watch file uses


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to