diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-09-09 23:54:47 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-09-11 09:29:50 +0200 |
commit | ca86006debc4570bbb3eacb71965c9d59be14084 (patch) | |
tree | e9c2343cd4059ddee06c00b11b9e4be1a6c5c35a | |
parent | 6b84438d9a9220fb75cbaae9d6fe6c3edb6d425e (diff) |
checksrc: detect and warn for lack of spaces next to plus signs
-rwxr-xr-x | lib/checksrc.pl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index f4ffa1ef3..3d3e51641 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -542,6 +542,19 @@ sub scanfile { "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++; $prevl = $ol; } |