History

checkpatch: handle comment/quote nesting correctly

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

Andy Whitcroft committed 18 years ago

Commit 81bc0e01 parent dea33491 file · +1 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+1−1
@@ -335,7 +335,7 @@ sub sanitise_line { · 334 unmodified lines
335 $off++;335 $off++;
336 next;336 next;
337 }337 }
338 if (substr($line, $off, 2) eq '*/') {338 if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') {
339 $sanitise_quote = '';339 $sanitise_quote = '';
340 substr($res, $off, 2, "$;$;");340 substr($res, $off, 2, "$;$;");
341 $off++;341 $off++;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t