Update supported ulimit flags for dash

Values are retrieved from https://linux.die.net/man/1/dash, search for
ulimit.

Fixes #1406
This commit is contained in:
Ng Zhi An 2018-12-22 22:16:24 +08:00
parent 08ca1ee6e9
commit bd04af0769
1 changed files with 3 additions and 1 deletions

View File

@ -136,6 +136,8 @@ prop_checkBashisms53= verifyNot checkBashisms "#!/bin/sh\nprintf -- -f\n"
prop_checkBashisms54= verify checkBashisms "#!/bin/sh\nfoo+=bar" prop_checkBashisms54= verify checkBashisms "#!/bin/sh\nfoo+=bar"
prop_checkBashisms55= verify checkBashisms "#!/bin/sh\necho ${@%foo}" prop_checkBashisms55= verify checkBashisms "#!/bin/sh\necho ${@%foo}"
prop_checkBashisms56= verifyNot checkBashisms "#!/bin/sh\necho ${##}" 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"
checkBashisms = ForShell [Sh, Dash] $ \t -> do checkBashisms = ForShell [Sh, Dash] $ \t -> do
params <- ask params <- ask
kludge params t kludge params t
@ -283,7 +285,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
("export", ["-p"]), ("export", ["-p"]),
("printf", []), ("printf", []),
("read", if isDash then ["r", "p"] else ["r"]), ("read", if isDash then ["r", "p"] else ["r"]),
("ulimit", ["f"]) ("ulimit", if isDash then ["H", "S", "t", "f", "d", "s", "c", "m", "l", "p", "n"] else ["f"])
] ]
bashism t@(T_SourceCommand id src _) = bashism t@(T_SourceCommand id src _) =
let name = fromMaybe "" $ getCommandName src let name = fromMaybe "" $ getCommandName src