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 <apw@shadowen.org> Cc: Jaswinder Singh <jaswinder@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
dea33496dd
commit
81bc0e0202
|
@ -335,7 +335,7 @@ sub sanitise_line {
|
||||||
$off++;
|
$off++;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if (substr($line, $off, 2) eq '*/') {
|
if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') {
|
||||||
$sanitise_quote = '';
|
$sanitise_quote = '';
|
||||||
substr($res, $off, 2, "$;$;");
|
substr($res, $off, 2, "$;$;");
|
||||||
$off++;
|
$off++;
|
||||||
|
|
Loading…
Reference in New Issue