]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
checksrc: verify space after semicolons
authorDaniel Stenberg <daniel@haxx.se>
Mon, 11 Sep 2017 07:25:31 +0000 (09:25 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 12 Sep 2017 07:50:24 +0000 (09:50 +0200)
lib/checksrc.pl

index 3d3e516416731b0b21121fea50736b6e56b7499e..535e3d9f5ce18f8b61e310696b6954c5e1fbe16b 100755 (executable)
@@ -61,6 +61,7 @@ my %warnings = (
     'ASSIGNWITHINCONDITION'  => 'assignment within conditional expression',
     'EQUALSNOSPACE'    => 'equals sign without following space',
     'NOSPACEEQUALS'    => 'equals sign without preceeding space',
+    'SEMINOSPACE'      => 'semicolon without following space',
     );
 
 sub readwhitelist {
@@ -555,6 +556,13 @@ sub scanfile {
                       "no space before plus sign");
         }
 
+        # check for semicolons without space next to it
+        if($nostr =~ /(.*)\;[a-z0-9]/i) {
+            checkwarn("SEMINOSPACE",
+                      $line, length($1)+1, $file, $ol,
+                      "no space after semilcolon");
+        }
+
         $line++;
         $prevl = $ol;
     }