mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
sh: Add test cases for break outside a loop.
In most shells (including our sh), break outside a loop does nothing with status 0, or at least does not abort. Therefore, scripts sometimes (buggily) depend on this.
This commit is contained in:
parent
e3242f9d08
commit
0fbff2deb9
2 changed files with 19 additions and 0 deletions
7
tools/regression/bin/sh/builtins/break4.4
Normal file
7
tools/regression/bin/sh/builtins/break4.4
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# $FreeBSD$
|
||||
|
||||
# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0)
|
||||
# appear to depend on it.
|
||||
|
||||
break
|
||||
exit 4
|
||||
12
tools/regression/bin/sh/builtins/break5.4
Normal file
12
tools/regression/bin/sh/builtins/break5.4
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# $FreeBSD$
|
||||
|
||||
# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0)
|
||||
# appear to depend on it.
|
||||
# In some uncommitted code, the subshell environment corrupted the outer
|
||||
# shell environment's state.
|
||||
|
||||
(for i in a b c; do
|
||||
exit 3
|
||||
done)
|
||||
break
|
||||
exit 4
|
||||
Loading…
Reference in a new issue