about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-12-03 00:14:05 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-12-03 00:14:05 +0000
commitbf3ee0f725411f3829f3b646692eaec14f03776d (patch)
treed2bc4d35633ac9173aeba68dca02e3a8fd83b93b
parent3bd51758efc701d0b78e08744478fcdeab3c632e (diff)
downloadzsh-bf3ee0f725411f3829f3b646692eaec14f03776d.tar.gz
zsh-bf3ee0f725411f3829f3b646692eaec14f03776d.tar.xz
zsh-bf3ee0f725411f3829f3b646692eaec14f03776d.zip
22049: bug exiting from sourced file within function
-rw-r--r--ChangeLog6
-rw-r--r--Src/init.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index aa6b64b66..c8a3c2a5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-12-03  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 22049: Src/init.c: "exit" within sourced file within shell
+	function caused return from sourced file but execution of function
+	continued.
+
 2005-11-30  Wayne Davison  <wayned@users.sourceforge.net>
 
 	* unposted: Src/Zle/zle_misc.c: fixed parsedigit() to have
diff --git a/Src/init.c b/Src/init.c
index c7f20a1bd..6751df6ba 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -1085,7 +1085,8 @@ source(char *s)
     loops = oloops;                  /* the # of nested loops we are in      */
     dosetopt(SHINSTDIN, oldshst, 1); /* SHINSTDIN option                     */
     errflag = 0;
-    retflag = 0;
+    if (!exit_pending)
+	retflag = 0;
     scriptname = old_scriptname;
     free(cmdstack);
     cmdstack = ocs;