diff options
author | jilles <jilles@FreeBSD.org> | 2014-10-12 13:12:06 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2014-10-12 13:12:06 +0000 |
commit | 2791f385b984a34d6a9ec9d1a14314a9d323d57f (patch) | |
tree | 86d62c7b646ab4b4cc272071c412e2e57f905fa0 /bin/sh/tests | |
parent | c60e1a8fc3c6e0e955c37437181901f57f1a3727 (diff) | |
download | FreeBSD-src-2791f385b984a34d6a9ec9d1a14314a9d323d57f.zip FreeBSD-src-2791f385b984a34d6a9ec9d1a14314a9d323d57f.tar.gz |
sh: Fix break/continue/return in multiline eval.
Example:
eval $'return\necho bad'
Diffstat (limited to 'bin/sh/tests')
-rw-r--r-- | bin/sh/tests/builtins/Makefile | 2 | ||||
-rw-r--r-- | bin/sh/tests/builtins/eval7.0 | 9 | ||||
-rw-r--r-- | bin/sh/tests/builtins/eval8.7 | 7 |
3 files changed, 18 insertions, 0 deletions
diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile index d5d96b5..5f5da4a 100644 --- a/bin/sh/tests/builtins/Makefile +++ b/bin/sh/tests/builtins/Makefile @@ -72,6 +72,8 @@ FILES+= eval3.0 FILES+= eval4.0 FILES+= eval5.0 FILES+= eval6.0 +FILES+= eval7.0 +FILES+= eval8.7 FILES+= exec1.0 FILES+= exec2.0 FILES+= exit1.0 diff --git a/bin/sh/tests/builtins/eval7.0 b/bin/sh/tests/builtins/eval7.0 new file mode 100644 index 0000000..a309c91 --- /dev/null +++ b/bin/sh/tests/builtins/eval7.0 @@ -0,0 +1,9 @@ +# $FreeBSD$ +# Assumes that break can break out of a loop outside eval. + +while :; do + eval "break +echo bad1" + echo bad2 + exit 3 +done diff --git a/bin/sh/tests/builtins/eval8.7 b/bin/sh/tests/builtins/eval8.7 new file mode 100644 index 0000000..af6064c --- /dev/null +++ b/bin/sh/tests/builtins/eval8.7 @@ -0,0 +1,7 @@ +# $FreeBSD$ + +f() { + eval "return 7 +echo bad2" +} +f |