Check cd flags under dash & POSIX sh (fixes #1457)
This commit is contained in:
parent
e0a4241baa
commit
c3a56659f4
|
@ -145,6 +145,8 @@ prop_checkBashisms62 = verify checkBashisms "#!/bin/sh\nexport -f foo"
|
||||||
prop_checkBashisms63 = verifyNot checkBashisms "#!/bin/sh\nexport -p"
|
prop_checkBashisms63 = verifyNot checkBashisms "#!/bin/sh\nexport -p"
|
||||||
prop_checkBashisms64 = verify checkBashisms "#!/bin/sh\nreadonly -a"
|
prop_checkBashisms64 = verify checkBashisms "#!/bin/sh\nreadonly -a"
|
||||||
prop_checkBashisms65 = verifyNot checkBashisms "#!/bin/sh\nreadonly -p"
|
prop_checkBashisms65 = verifyNot checkBashisms "#!/bin/sh\nreadonly -p"
|
||||||
|
prop_checkBashisms66 = verifyNot checkBashisms "#!/bin/sh\ncd -P ."
|
||||||
|
prop_checkBashisms67 = verify checkBashisms "#!/bin/sh\ncd -P -e ."
|
||||||
checkBashisms = ForShell [Sh, Dash] $ \t -> do
|
checkBashisms = ForShell [Sh, Dash] $ \t -> do
|
||||||
params <- ask
|
params <- ask
|
||||||
kludge params t
|
kludge params t
|
||||||
|
@ -288,6 +290,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
|
||||||
"typeset"
|
"typeset"
|
||||||
] ++ if not isDash then ["local"] else []
|
] ++ if not isDash then ["local"] else []
|
||||||
allowedFlags = Map.fromList [
|
allowedFlags = Map.fromList [
|
||||||
|
("cd", ["L", "P"]),
|
||||||
("exec", []),
|
("exec", []),
|
||||||
("export", ["p"]),
|
("export", ["p"]),
|
||||||
("jobs", ["l", "p"]),
|
("jobs", ["l", "p"]),
|
||||||
|
|
Loading…
Reference in New Issue