Messages in this thread Patch in this message |  | | | Subject | [PATCH 2.6.24-rc8-mm1] checkpatch.pl -- Handle backslashes within quoted string. | | From | Tetsuo Handa <> | | Date | Fri, 18 Jan 2008 22:21:00 +0900 |
| |
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 <penguin-kernel@I-love.SAKURA.ne.jp> --- 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;
|  |