diff options
| author | Jilles Tjoelker <jilles@FreeBSD.org> | 2014-10-12 13:12:06 +0000 |
|---|---|---|
| committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2014-10-12 13:12:06 +0000 |
| commit | 75e1716807730619eddd56dbd59b9b34003e40e3 (patch) | |
| tree | 86d62c7b646ab4b4cc272071c412e2e57f905fa0 /bin | |
| parent | 387dcafe06d4512cb0c674012b909eec5b9f63ca (diff) | |
Notes
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/sh/eval.c | 2 | ||||
| -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 |
4 files changed, 20 insertions, 0 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index ea2d2641e7e9..38e227c7d74d 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -168,6 +168,8 @@ evalstring(char *s, int flags) else evaltree(n, flags); any = 1; + if (evalskip) + break; } popstackmark(&smark); setstackmark(&smark); diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile index d5d96b58a48c..5f5da4a89077 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 000000000000..a309c917b102 --- /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 000000000000..af6064c388df --- /dev/null +++ b/bin/sh/tests/builtins/eval8.7 @@ -0,0 +1,7 @@ +# $FreeBSD$ + +f() { + eval "return 7 +echo bad2" +} +f |
