From: Andy Whitcroft Date: Thu, 16 Oct 2008 05:02:26 +0000 (-0700) Subject: checkpatch: handle comment/quote nesting correctly X-Git-Tag: v2.6.28-rc1~478 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=81bc0e020232a1e1e7010376382bb59ca82927ac;p=linux-2.6-omap-h63xx.git checkpatch: handle comment/quote nesting correctly Ensure that a close comment cannot incorrectly trigger in the middle of a string. Reported by Jaswinder Singh. Signed-off-by: Andy Whitcroft Cc: Jaswinder Singh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5382f728739..18646f076a8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -335,7 +335,7 @@ sub sanitise_line { $off++; next; } - if (substr($line, $off, 2) eq '*/') { + if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') { $sanitise_quote = ''; substr($res, $off, 2, "$;$;"); $off++;