Subject: [PATCH 15/18] checkbashisms: improve the "'function' is useless" check

From: Raphael Geissert <[email-masked]>
Date: Tue, 23 Oct 2012 12:46:30 -0500

Similar to 5dc48224 in that it matches other characters.

Signed-off-by: Raphael Geissert <[email-masked]>
---
 scripts/checkbashisms.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkbashisms.pl b/scripts/checkbashisms.pl
index 5cf9152..4bf0404 100755
--- a/scripts/checkbashisms.pl
+++ b/scripts/checkbashisms.pl
@@ -563,7 +563,7 @@ sub script_is_evil_and_wrong {
 sub init_hashes {
 
     %bashisms = (
-	qr'(?:^|\s+)function \w+(\s|\(|\Z)' => q<'function' is useless>,
+	qr'(?:^|\s+)function [^<>\(\)\[\]\{\};|\s]+(\s|\(|\Z)' => q<'function' is useless>,
 	$LEADIN . qr'select\s+\w+' =>     q<'select' is not POSIX>,
 	qr'(test|-o|-a)\s*[^\s]+\s+==\s' => q<should be 'b = a'>,
 	qr'\[\s+[^\]]+\s+==\s' =>        q<should be 'b = a'>,
-- 
1.7.10