From bd04af0769c3ca643bff0920c27028a6cc84fe02 Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Sat, 22 Dec 2018 22:16:24 +0800 Subject: [PATCH] Update supported ulimit flags for dash Values are retrieved from https://linux.die.net/man/1/dash, search for ulimit. Fixes #1406 --- src/ShellCheck/Checks/ShellSupport.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ShellCheck/Checks/ShellSupport.hs b/src/ShellCheck/Checks/ShellSupport.hs index 1bc425f..02f2bfa 100644 --- a/src/ShellCheck/Checks/ShellSupport.hs +++ b/src/ShellCheck/Checks/ShellSupport.hs @@ -136,6 +136,8 @@ prop_checkBashisms53= verifyNot checkBashisms "#!/bin/sh\nprintf -- -f\n" prop_checkBashisms54= verify checkBashisms "#!/bin/sh\nfoo+=bar" 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" checkBashisms = ForShell [Sh, Dash] $ \t -> do params <- ask kludge params t @@ -283,7 +285,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do ("export", ["-p"]), ("printf", []), ("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 _) = let name = fromMaybe "" $ getCommandName src