From owner-cvs-src-old@FreeBSD.ORG Sun Aug 15 21:07:45 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A31C106567A for ; Sun, 15 Aug 2010 21:07:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 576F38FC15 for ; Sun, 15 Aug 2010 21:07:45 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id o7FL7j0R098266 for ; Sun, 15 Aug 2010 21:07:45 GMT (envelope-from jilles@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id o7FL7jIn098265 for cvs-src-old@freebsd.org; Sun, 15 Aug 2010 21:07:45 GMT (envelope-from jilles@repoman.freebsd.org) Message-Id: <201008152107.o7FL7jIn098265@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jilles@repoman.freebsd.org using -f From: Jilles Tjoelker Date: Sun, 15 Aug 2010 21:06:53 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/sh main.c src/tools/regression/bin/sh/builtins break1.0 return5.0 X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2010 21:07:45 -0000 jilles 2010-08-15 21:06:53 UTC FreeBSD src repository Modified files: bin/sh main.c Added files: tools/regression/bin/sh/builtins break1.0 return5.0 Log: SVN rev 211349 on 2010-08-15 21:06:53Z by jilles sh: Fix break/continue/return sometimes not skipping the rest of dot script. In our implementation and most others, a break or continue in a dot script can break or continue a loop outside the dot script. This should cause all further commands in the dot script to be skipped. However, cmdloop() did not know about this and continued to parse and execute commands from the dot script. As described in the man page, a return in a dot script in a function returns from the function, not only from the dot script. There was a similar issue as with break and continue. In various other shells, the return appears to return from the dot script, but POSIX seems not very clear about this. Revision Changes Path 1.40 +3 -2 src/bin/sh/main.c 1.1 +16 -0 src/tools/regression/bin/sh/builtins/break1.0 (new) 1.1 +17 -0 src/tools/regression/bin/sh/builtins/return5.0 (new)