Unverified Commit ca86006d authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

checksrc: detect and warn for lack of spaces next to plus signs

parent 6b84438d
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -542,6 +542,19 @@ sub scanfile {
                      "no space before equals sign");
                      "no space before equals sign");
        }
        }


        # check for plus signs without spaces next to it
        if($nostr =~ /(.*)[^+]\+[a-z0-9]/i) {
            checkwarn("PLUSNOSPACE",
                      $line, length($1)+1, $file, $ol,
                      "no space after plus sign");
        }
        # check for plus sign without spaces before it
        elsif($nostr =~ /(.*)[a-z0-9]\+[^+]/i) {
            checkwarn("NOSPACEPLUS",
                      $line, length($1)+1, $file, $ol,
                      "no space before plus sign");
        }

        $line++;
        $line++;
        $prevl = $ol;
        $prevl = $ol;
    }
    }