svn commit: r211609 - head/tools/regression/bin/sh/builtins

Jilles Tjoelker jilles at FreeBSD.org
Sun Aug 22 11:04:30 UTC 2010


Author: jilles
Date: Sun Aug 22 11:04:30 2010
New Revision: 211609
URL: http://svn.freebsd.org/changeset/base/211609

Log:
  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.

Added:
  head/tools/regression/bin/sh/builtins/break3.0   (contents, props changed)

Added: head/tools/regression/bin/sh/builtins/break3.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/break3.0	Sun Aug 22 11:04:30 2010	(r211609)
@@ -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


More information about the svn-src-all mailing list