Subject: [PATCH 05/18] checkbashisms: detect traps for DEBUG, ERRNO, or RETURN

From: Raphael Geissert <[email-masked]>
Date: Sun, 21 Oct 2012 00:46:57 -0500

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

diff --git a/scripts/checkbashisms.pl b/scripts/checkbashisms.pl
index 861ec6f..ecd64f1 100755
--- a/scripts/checkbashisms.pl
+++ b/scripts/checkbashisms.pl
@@ -595,6 +595,7 @@ sub init_hashes {
 #	$LEADIN . qr'jobs\s+-[^lp]\s' =>  q<'jobs' with option other than -l or -p>,
 	$LEADIN . qr'command\s+-[^p]\s' =>  q<'command' with option other than -p>,
 	$LEADIN . qr'setvar\s' =>  q<setvar 'foo' 'bar' should be eval 'foo="'"$bar"'"'>,
+	$LEADIN . qr'trap\s+["\']?.*["\']?\s+.*(?:ERR|DEBUG|RETURN)' => q<trap with ERR|DEBUG|RETURN>,
     );
 
     %string_bashisms = (
-- 
1.7.10