From bf3ee0f725411f3829f3b646692eaec14f03776d Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 3 Dec 2005 00:14:05 +0000 Subject: 22049: bug exiting from sourced file within function --- ChangeLog | 6 ++++++ Src/init.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index aa6b64b66..c8a3c2a5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-12-03 Peter Stephenson + + * 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 * 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; -- cgit 1.4.1