From ca86006debc4570bbb3eacb71965c9d59be14084 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 9 Sep 2017 23:54:47 +0200 Subject: checksrc: detect and warn for lack of spaces next to plus signs --- lib/checksrc.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; } -- cgit v1.2.3