The following commit has been merged in the master branch:
commit 33bcd33da9c9bb523c17241dbc34b05b6ad26a5f
Author: Raphael Geissert <[email protected]>
Date: Wed May 12 13:27:30 2010 -0500
checkbashisms: detect some printf-related bashisms
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 f5c79e4..1074ed9 100755
--- a/scripts/checkbashisms.pl
+++ b/scripts/checkbashisms.pl
@@ -518,6 +518,7 @@ sub init_hashes {
$LEADIN . qr'(sh|\$\{?SHELL\}?) --\w+' => q<sh --long-option>,
$LEADIN . qr'(sh|\$\{?SHELL\}?) [-+]O' => q<sh [-+]O>,
qr'\[\^[^]]+\]' => q<[^] should be [!]>,
+ $LEADIN . qr'printf\s+-v' => q<'printf -v var ...' should be
var='$(printf ...)'>,
);
%string_bashisms = (
@@ -544,6 +545,7 @@ sub init_hashes {
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))'>,
+ $LEADIN . qr'printf\s["\'][^"\']+?%[qb].+?["\']' => q<printf %q|%b>,
);
%singlequote_bashisms = (
--
Git repository for devscripts
--
To unsubscribe, send mail to [email protected].