The following commit has been merged in the master branch:
commit 4b7f7b6d4ae2bcb2693efb3cdbd6d12c7e80df48
Author: Raphael Geissert <[email protected]>
Date: Wed May 12 17:19:10 2010 -0500
checkbashisms: improve detection of n++-like arithmetic
Signed-off-by: Raphael Geissert <[email protected]>
Signed-off-by: James Vega <[email protected]>
diff --git a/scripts/checkbashisms.pl b/scripts/checkbashisms.pl
index 5b5a34c..02698af 100755
--- a/scripts/checkbashisms.pl
+++ b/scripts/checkbashisms.pl
@@ -556,10 +556,10 @@ sub init_hashes {
qr'\$\{?SHLVL\}?\b' => q<$SHLVL>,
qr'<<<' => q<\<\<\< here string>,
$LEADIN . qr'echo\s+(?:-[^e\s]+\s+)?\"[^\"]*(\\[abcEfnrtv0])+.*?[\"]'
=> q<unsafe echo with backslash>,
- qr'\$\(\(\s*\w+\+\+\s*\)\)' => q<'$((n++))' should be '$n;
$((n=n+1))'>,
- qr'\$\(\(\s*\+\+\w+\s*\)\)' => q<'$((++n))' should be '$((n=n+1))'>,
- qr'\$\(\(\s*\w+\-\-\s*\)\)' => q<'$((n--))' should be '$n;
$((n=n-1))'>,
- qr'\$\(\(\s*\-\-\w+\s*\)\)' => q<'$((--n))' should be '$((n=n-1))'>,
+ qr'\$\(\([\s\w$*/+-]*\w\+\+.*?\)\)' => q<'$((n++))' should be '$n;
$((n=n+1))'>,
+ qr'\$\(\([\s\w$*/+-]*\+\+\w.*?\)\)' => q<'$((++n))' should be
'$((n=n+1))'>,
+ qr'\$\(\([\s\w$*/+-]*\w\-\-.*?\)\)' => q<'$((n--))' should be '$n;
$((n=n-1))'>,
+ qr'\$\(\([\s\w$*/+-]*\-\-\w.*?\)\)' => q<'$((--n))' should be
'$((n=n-1))'>,
$LEADIN . qr'printf\s["\'][^"\']+?%[qb].+?["\']' => q<printf %q|%b>,
);
--
Git repository for devscripts
--
To unsubscribe, send mail to [email protected].