From: Daniel Stenberg Date: Sat, 9 Sep 2017 21:54:47 +0000 (+0200) Subject: checksrc: detect and warn for lack of spaces next to plus signs X-Git-Tag: curl-7_56_0~71 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca86006debc4570bbb3eacb71965c9d59be14084;p=curl checksrc: detect and warn for lack of spaces next to plus signs --- 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; }