mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
sh: Add a test for breaking from a loop outside the current function.
It is unwise to rely on this but I'd like to know if this would break.
This commit is contained in:
parent
c6f5742f90
commit
193da04bd8
1 changed files with 15 additions and 0 deletions
15
tools/regression/bin/sh/builtins/break3.0
Normal file
15
tools/regression/bin/sh/builtins/break3.0
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# $FreeBSD$
|
||||
|
||||
# We accept this and people might rely on it.
|
||||
# However, various other shells do not accept it.
|
||||
|
||||
f() {
|
||||
break
|
||||
echo bad1
|
||||
}
|
||||
|
||||
while :; do
|
||||
f
|
||||
echo bad2
|
||||
exit 2
|
||||
done
|
||||
Loading…
Reference in a new issue