From d8f3792dadb678df82cee0c6a5ca1b6fa75b51b6 Mon Sep 17 00:00:00 2001 From: Daniel Walker Date: Mon, 21 Sep 2009 17:04:35 -0700 Subject: [PATCH] --- yaml --- r: 164529 b: refs/heads/master c: 113f04a836481e9ecc26e8dee8b0e4d52878a288 h: refs/heads/master i: 164527: dccd78603af71c403c6b15ca85688d2fc76cd77f v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 7d16b0496b5f..34efa4da5d5a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 463f28648586721c2191130c9b3c27589dcc11a0 +refs/heads/master: 113f04a836481e9ecc26e8dee8b0e4d52878a288 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index fd6481649258..aa009a3b5b81 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -356,6 +356,13 @@ sub sanitise_line { $off++; next; } + if ($sanitise_quote eq '' && substr($line, $off, 2) eq '//') { + $sanitise_quote = '//'; + + substr($res, $off, 2, $sanitise_quote); + $off++; + next; + } # A \ in a string means ignore the next character. if (($sanitise_quote eq "'" || $sanitise_quote eq '"') && @@ -379,6 +386,8 @@ sub sanitise_line { #print "c<$c> SQ<$sanitise_quote>\n"; if ($off != 0 && $sanitise_quote eq '*/' && $c ne "\t") { substr($res, $off, 1, $;); + } elsif ($off != 0 && $sanitise_quote eq '//' && $c ne "\t") { + substr($res, $off, 1, $;); } elsif ($off != 0 && $sanitise_quote && $c ne "\t") { substr($res, $off, 1, 'X'); } else { @@ -386,6 +395,10 @@ sub sanitise_line { } } + if ($sanitise_quote eq '//') { + $sanitise_quote = ''; + } + # The pathname on a #include may be surrounded by '<' and '>'. if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) { my $clean = 'X' x length($1);