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:
Jilles Tjoelker 2010-08-22 11:04:30 +00:00
parent c6f5742f90
commit 193da04bd8

View 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