[PATCH 3/7] checkpatch: handle comment/quote nesting correctly

From: Andy Whitcroft
Date: Tue Sep 02 2008 - 13:27:38 EST


Ensure that a close comment cannot incorrectly trigger in the middle
of a string. Reported by Jaswinder Singh.

Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxx>
Cc: Jaswinder Singh <jaswinder@xxxxxxxxxxxxx>
---
scripts/checkpatch.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5382f72..18646f0 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++;
--
1.6.0.rc1.258.g80295

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/