Merge pull request #1462 from contivero/trap-flags

Check trap flags under dash & POSIX sh (fixes #1461)
This commit is contained in:
Vidar Holen 2019-01-20 14:48:01 -08:00 committed by GitHub
commit 978bfdd5da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"])
]