checksrc: detect // comments on column 0

Spotted while working on #6045

Closes #6048
This commit is contained in:
Daniel Stenberg 2020-10-07 09:11:03 +02:00
parent bc5455fa74
commit 7d8c89d47b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -442,7 +442,7 @@ sub scanfile {
# crude attempt to detect // comments without too many false
# positives
if($l =~ /^([^"\*]*)[^:"]\/\//) {
if($l =~ /^(([^"\*]*)[^:"]|)\/\//) {
checkwarn("CPPCOMMENTS",
$line, length($1), $file, $l, "\/\/ comment");
}