checkpatch.pl was unable to handle \\ within quoted string.

+static void test(char *sp, char *dp)
+{
+       if (*sp == '\\') {
+               *dp++ = '\\';
+               *dp++ = '\\';
+       }
+}

I hope this patch can fix it.
But I don't know whether there is a side effect or not.
Should we use "X" rather than "\\"?

Signed-off-by: Tetsuo Handa <[EMAIL PROTECTED]>
---
 scripts/checkpatch.pl |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- linux-2.6-mm.orig/scripts/checkpatch.pl
+++ linux-2.6-mm/scripts/checkpatch.pl
@@ -276,6 +276,11 @@ sub sanitise_line {
        my $quote = '';
 
        foreach my $c (split(//, $line)) {
+               if ($quote && $l eq "\\" && $c eq "\\") {
+                       $res .= "\\";
+                       $l = '';
+                       next;
+               }
                if ($l ne "\\" && ($c eq "'" || $c eq '"')) {
                        if ($quote eq '') {
                                $quote = $c;
@@ -286,7 +291,7 @@ sub sanitise_line {
                                $quote = '';
                        }
                }
-               if ($quote && $c ne "\t") {
+               if ($quote && $c ne "\t" && $c ne "\\") {
                        $res .= "X";
                } else {
                        $res .= $c;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to