]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
checksrc: detect // comments on column 0
authorDaniel Stenberg <daniel@haxx.se>
Wed, 7 Oct 2020 07:11:03 +0000 (09:11 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 7 Oct 2020 08:14:50 +0000 (10:14 +0200)
Spotted while working on #6045

Closes #6048

lib/checksrc.pl

index f9d076a2f8e2c877e22907f16fd248f70e5e2ed3..78b9cef5bd3977d3a1a084d9b62aff6a751e47cb 100755 (executable)
@@ -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");
         }