mirror of
https://github.com/curl/curl.git
synced 2026-07-22 22:47:17 +03:00
checksrc.pl: detect assign followed by more than one space
And fix some code previously doing this. Closes #19375
This commit is contained in:
parent
c12a1fdd0e
commit
6d7e924e80
5 changed files with 20 additions and 13 deletions
|
|
@ -131,6 +131,7 @@ my %warnings = (
|
|||
'DOBRACE' => 'A single space between do and open brace',
|
||||
'EMPTYLINEBRACE' => 'Empty line before the open brace',
|
||||
'EQUALSNOSPACE' => 'equals sign without following space',
|
||||
'EQUALSPACE' => 'equals sign with too many spaces following',
|
||||
'EQUALSNULL' => 'if/while comparison with == NULL',
|
||||
'ERRNOVAR' => 'use of bare errno define',
|
||||
'EXCLAMATIONSPACE' => 'Whitespace after exclamation mark in expression',
|
||||
|
|
@ -1039,6 +1040,12 @@ sub scanfile {
|
|||
$line, length($1)+1, $file, $ol,
|
||||
"no space before equals sign");
|
||||
}
|
||||
# check for equals sign with more than one space after it
|
||||
elsif($l =~ /(.*)[a-z0-9] \= /i) {
|
||||
checkwarn("EQUALSPACE",
|
||||
$line, length($1)+3, $file, $ol,
|
||||
"more than one space after equals sign");
|
||||
}
|
||||
|
||||
# check for plus signs without spaces next to it
|
||||
if($nostr =~ /(.*)[^+]\+[a-z0-9]/i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue