Date: Sun, 15 Aug 2010 21:06:53 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/bin/sh main.c src/tools/regression/bin/sh/builtins break1.0 return5.0 Message-ID: <201008152107.o7FL7jIn098265@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008152107.o7FL7jIn098265>
