Check trap flags under dash & POSIX sh (fixes #1461)

This commit is contained in:
Cristian Adrián Ontivero 2019-01-16 08:44:41 +01:00
parent c6c615217b
commit 8e31e86cc4
No known key found for this signature in database
GPG Key ID: 00B7629CAD43E113
1 changed files with 2 additions and 0 deletions

View File

@ -149,6 +149,7 @@ prop_checkBashisms66 = verifyNot checkBashisms "#!/bin/sh\ncd -P ."
prop_checkBashisms67 = verify checkBashisms "#!/bin/sh\ncd -P -e ."
prop_checkBashisms68 = verify checkBashisms "#!/bin/sh\numask -p"
prop_checkBashisms69 = verifyNot checkBashisms "#!/bin/sh\numask -S"
prop_checkBashisms70 = verify checkBashisms "#!/bin/sh\ntrap -l"
checkBashisms = ForShell [Sh, Dash] $ \t -> do
params <- ask
kludge params t
@ -300,6 +301,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
("printf", Just []),
("read", Just $ if isDash then ["r", "p"] else ["r"]),
("readonly", Just ["p"]),
("trap", Just []),
("ulimit", if isDash then Nothing else Just ["f"]),
("umask", Just ["S"])
]