checkpatch: complex macros -- fix up extension handling
authorAndy Whitcroft <apw@shadowen.org>
Thu, 16 Oct 2008 05:02:18 +0000 (22:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Oct 2008 18:21:35 +0000 (11:21 -0700)
Only pull in new extension lines where the current contents ends with a \.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index 303c363..586f9a4 100755 (executable)
@@ -1977,8 +1977,8 @@ sub process {
                        # Extract the remainder of the define (if any) and
                        # rip off surrounding spaces, and trailing \'s.
                        $rest = '';
-                       while ($off != 0 || ($cnt > 0 && $rest =~ /(?:^|\\)\s*$/)) {
-                               #print "ADDING $off <" . substr($lines[$ln - 1], $off) . ">\n";
+                       while ($off != 0 || ($cnt > 0 && $rest =~ /\\\s*$/)) {
+                               #print "ADDING cnt<$cnt> $off <" . substr($lines[$ln - 1], $off) . "> rest<$rest>\n";
                                if ($off != 0 || $lines[$ln - 1] !~ /^-/) {
                                        $rest .= substr($lines[$ln - 1], $off) . "\n";
                                        $cnt--;