diff options
author | jilles <jilles@FreeBSD.org> | 2010-03-06 17:09:22 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2010-03-06 17:09:22 +0000 |
commit | c30671a949eb9683bebf9a37cc4e35a46fde00d9 (patch) | |
tree | 4b967f0eefc77e4d0c584d3f2269ffeb52a3bfb8 /tools/regression | |
parent | 1bfbe947abf36034bc4aa54fb61824fb8153e43f (diff) | |
download | FreeBSD-src-c30671a949eb9683bebf9a37cc4e35a46fde00d9.zip FreeBSD-src-c30671a949eb9683bebf9a37cc4e35a46fde00d9.tar.gz |
sh: Make sure to popredir() even if a special builtin caused an error.
Diffstat (limited to 'tools/regression')
-rw-r--r-- | tools/regression/bin/sh/builtins/command9.0 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/command9.0 b/tools/regression/bin/sh/builtins/command9.0 new file mode 100644 index 0000000..212e52a --- /dev/null +++ b/tools/regression/bin/sh/builtins/command9.0 @@ -0,0 +1,14 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "[ $* ]"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +check '"$({ command eval shift x 2>/dev/null; } >/dev/null; echo hi)" = hi' + +exit $((failures > 0)) |