about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-09-26 10:28:34 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-09-26 10:28:34 +0000
commitaf359d24a42d70ef037d1e298cba99f053317a03 (patch)
treefba9ccc741263ce30be8b16cf05b199c5907fcfd
parentef66a233de52414286532b09dfac244cc35ef198 (diff)
downloadzsh-af359d24a42d70ef037d1e298cba99f053317a03.tar.gz
zsh-af359d24a42d70ef037d1e298cba99f053317a03.tar.xz
zsh-af359d24a42d70ef037d1e298cba99f053317a03.zip
users/11883: return at top level caused following precommand functions
to return immediately
-rw-r--r--ChangeLog5
-rw-r--r--Src/init.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 626ab87ec..980827f62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-26  Peter Stephenson  <pws@csr.com>
+
+	* users/11883: Src/init.c: "return" at top level caused
+	following precommand functions to return immediately.
+
 2007-09-26  Clint Adams  <clint@zsh.org>
 
 	* 23834: Completion/Unix/Type/_tex: complete tex files for xetex
diff --git a/Src/init.c b/Src/init.c
index 980d3b1c9..55f32079b 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -1343,9 +1343,11 @@ zsh_main(UNUSED(int argc), char **argv)
 	 */
 	maybeshrinkjobtab();
 
-	do
+	do {
+	    /* Reset return from top level which gets us back here */
+	    retflag = 0;
 	    loop(1,0);
-	while (tok != ENDINPUT && (tok != LEXERR || isset(SHINSTDIN)));
+	} while (tok != ENDINPUT && (tok != LEXERR || isset(SHINSTDIN)));
 	if (tok == LEXERR) {
 	    /* Make sure a parse error exits with non-zero status */
 	    if (!lastval)