diff options
author | jilles <jilles@FreeBSD.org> | 2013-04-12 15:19:35 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-04-12 15:19:35 +0000 |
commit | 8b2029265883067bf67b0fa209dd4f6e47c48e3f (patch) | |
tree | 0aac568cbf8c2959f1e1a7008c5231687838385b /tools/regression/bin | |
parent | fd27383897a40fb960ee449c2c656b991babd97d (diff) | |
download | FreeBSD-src-8b2029265883067bf67b0fa209dd4f6e47c48e3f.zip FreeBSD-src-8b2029265883067bf67b0fa209dd4f6e47c48e3f.tar.gz |
sh: Don't modify exit status when break/continue/return passes !.
This matches what would happen if ! P were to be replaced with
if P; then false; else true; fi.
Example:
f() { ! return 0; }; f
Diffstat (limited to 'tools/regression/bin')
-rw-r--r-- | tools/regression/bin/sh/execution/not1.0 | 4 | ||||
-rw-r--r-- | tools/regression/bin/sh/execution/not2.0 | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/execution/not1.0 b/tools/regression/bin/sh/execution/not1.0 new file mode 100644 index 0000000..12c6265 --- /dev/null +++ b/tools/regression/bin/sh/execution/not1.0 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +f() { ! return $1; } +f 0 && ! f 1 diff --git a/tools/regression/bin/sh/execution/not2.0 b/tools/regression/bin/sh/execution/not2.0 new file mode 100644 index 0000000..1b128d0 --- /dev/null +++ b/tools/regression/bin/sh/execution/not2.0 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +while :; do + ! break + exit 3 +done |