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
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 New Issue
Block a user