about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Src/init.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 903f9848e..9992f5874 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  Peter Stephenson  <pws@csr.com>
 
 	* unposted: Etc/FAQ.yo: release 4.2.6.
diff --git a/Src/init.c b/Src/init.c
index 9afa2f24e..58b390bfa 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -1060,7 +1060,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;