Check readonly flags in dash/POSIX sh (fixes #1448)

This commit is contained in:
Cristian Adrián Ontivero 2019-01-10 11:03:33 +01:00
parent fcdd6055df
commit 3760e7945f
No known key found for this signature in database
GPG Key ID: 00B7629CAD43E113
1 changed files with 3 additions and 1 deletions

View File

@ -143,7 +143,8 @@ prop_checkBashisms60 = verifyNot checkBashisms "#!/bin/sh\njobs -p"
prop_checkBashisms61 = verifyNot checkBashisms "#!/bin/sh\njobs -lp" prop_checkBashisms61 = verifyNot checkBashisms "#!/bin/sh\njobs -lp"
prop_checkBashisms62 = verify checkBashisms "#!/bin/sh\nexport -f foo" 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_checkBashisms65 = verifyNot checkBashisms "#!/bin/sh\nreadonly -p"
checkBashisms = ForShell [Sh, Dash] $ \t -> do checkBashisms = ForShell [Sh, Dash] $ \t -> do
params <- ask params <- ask
kludge params t kludge params t
@ -292,6 +293,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
("jobs", ["l", "p"]), ("jobs", ["l", "p"]),
("printf", []), ("printf", []),
("read", if isDash then ["r", "p"] else ["r"]), ("read", if isDash then ["r", "p"] else ["r"]),
("readonly", ["p"]),
("ulimit", if isDash then ["H", "S", "t", "f", "d", "s", "c", "m", "l", "p", "n"] else ["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 _) =