1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 15:48:49 -05:00

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

This commit is contained in:
Daniel Stenberg 2017-09-09 23:54:47 +02:00
parent 6b84438d9a
commit ca86006deb
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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;
}