Check jobs flags in dash/POSIX sh (fixes #1429)

This commit is contained in:
Cristian Adrián Ontivero 2018-12-28 00:23:17 -03:00
parent 1b4c486748
commit 73a41cdd2f
No known key found for this signature in database
GPG Key ID: 00B7629CAD43E113
1 changed files with 5 additions and 0 deletions

View File

@ -138,6 +138,10 @@ prop_checkBashisms55= verify checkBashisms "#!/bin/sh\necho ${@%foo}"
prop_checkBashisms56= verifyNot checkBashisms "#!/bin/sh\necho ${##}"
prop_checkBashisms57= verifyNot checkBashisms "#!/bin/dash\nulimit -c 0"
prop_checkBashisms58= verify checkBashisms "#!/bin/sh\nulimit -c 0"
prop_checkBashisms59 = verify checkBashisms "#!/bin/sh\njobs -s"
prop_checkBashisms60 = verifyNot checkBashisms "#!/bin/sh\njobs -p"
prop_checkBashisms61 = verifyNot checkBashisms "#!/bin/sh\njobs -lp"
checkBashisms = ForShell [Sh, Dash] $ \t -> do
params <- ask
kludge params t
@ -283,6 +287,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
allowedFlags = Map.fromList [
("exec", []),
("export", ["-p"]),
("jobs", ["l", "p"]),
("printf", []),
("read", if isDash then ["r", "p"] else ["r"]),
("ulimit", if isDash then ["H", "S", "t", "f", "d", "s", "c", "m", "l", "p", "n"] else ["f"])