Subject: [PATCH 4/4] checkbashisms: detect substr expansion with dynamic length (Closes: #610465)

From: Raphael Geissert <[email-masked]>
Date: Thu, 19 Apr 2012 23:46:19 -0500

---
 scripts/checkbashisms.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/checkbashisms.pl b/scripts/checkbashisms.pl
index 8840d55..3c92700 100755
--- a/scripts/checkbashisms.pl
+++ b/scripts/checkbashisms.pl
@@ -576,7 +576,7 @@ sub init_hashes {
 
     %string_bashisms = (
 	qr'\$\[[^][]+\]' =>	         q<'$[' should be '$(('>,
-	qr'\$\{\w+\:\d+(?::\d+)?\}' =>   q<${foo:3[:1]}>,
+	qr'\$\{\w+\:(?:\d+|\$\{?\w+\}?)+(?::(?:\d+|\$\{?\w+\}?)+)?\}' =>   q<${foo:3[:1]}>,
 	qr'\$\{!\w+[\@*]\}' =>           q<${!prefix[*|@]>,
 	qr'\$\{!\w+\}' =>                q<${!name}>,
 	qr'\$\{\w+(/.+?){1,2}\}' =>      q<${parm/?/pat[/str]}>,
-- 
1.7.9.1