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