Ensure that a close comment cannot incorrectly trigger in the middle of a string. Reported by Jaswinder Singh.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -335,7 +335,7 @@ sub sanitise_line { · 334 unmodified lines | ||
| 335 | 335 | $off++; |
| 336 | 336 | next; |
| 337 | 337 | } |
| 338 | − if (substr($line, $off, 2) eq '*/') { | |
| 338 | + if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') { | |
| 339 | 339 | $sanitise_quote = ''; |
| 340 | 340 | substr($res, $off, 2, "$;$;"); |
| 341 | 341 | $off++; |