Skip to content

Commit

Permalink
checkpatch: handle comment/quote nesting correctly
Browse files Browse the repository at this point in the history
Ensure that a close comment cannot incorrectly trigger in the middle of a
string.  Reported by Jaswinder Singh.

Signed-off-by: Andy Whitcroft <[email protected]>
Cc: Jaswinder Singh <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
awhitcroft authored and torvalds committed Oct 16, 2008
1 parent dea3349 commit 81bc0e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 81bc0e0

Please sign in to comment.