]> granicus.if.org Git - curl/commitdiff
checksrc: add crude // detection
authorDaniel Stenberg <daniel@haxx.se>
Wed, 21 Oct 2015 11:46:03 +0000 (13:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 21 Oct 2015 21:18:04 +0000 (23:18 +0200)
lib/checksrc.pl
lib/checksrc.whitelist

index 8fad2cfcbfca1353c4ca25cb728d56264e839235..ddd0b36236ed8ee0f50e1a62c2c6b4e3a5a26849 100755 (executable)
@@ -143,6 +143,11 @@ sub scanfile {
             checkwarn($line, length($1), $file, $l, "Trailing whitespace");
         }
 
+        # crude attempt to detect // comments without too many false
+        # positives
+        if($l =~ /^([^"\*]*)[^:"]\/\//) {
+            checkwarn($line, length($1), $file, $l, "\/\/ comment");
+        }
         # check spaces after for/if/while
         if($l =~ /^(.*)(for|if|while) \(/) {
             if($1 =~ / *\#/) {
index e261b9da1ac529efcb8eb60a972ffeb4679e79fe..d20909bdc2699727685e0135784732e9fadc638e 100644 (file)
@@ -8,3 +8,4 @@
     return fopen(file, "r"); /* VMS */
     return fopen(file, "r", "rfm=stmlf", "ctx=stm");
     curl_memlog("FILE %s:%d fopen(\"%s\",\"%s\") = %p\n",
+           a URL as file://localhost//foo must be valid as well, to refer to