From d24d7242fecec5a6d9db6f27f7439281dfa17021 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Thu, 14 Apr 2022 16:31:50 -0700 Subject: 50068: 'exit' in trap causes calling function to return --- Src/builtin.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Src/builtin.c') diff --git a/Src/builtin.c b/Src/builtin.c index 8ef678b22..b93466ba5 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -5720,6 +5720,8 @@ bin_break(char *name, char **argv, UNUSED(Options ops), int func) * a bad job. */ if (stopmsg || (zexit(0, ZEXIT_DEFERRED), !stopmsg)) { + if (trap_state) + trap_state = TRAP_STATE_FORCE_RETURN; retflag = 1; breaks = loops; exit_pending = 1; -- cgit v1.2.3 From e127ceaae87414588d4c839fc4cc04f02c2ed8c5 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sat, 30 Apr 2022 11:21:03 -0700 Subject: 50149: Remove all remaining =(...) files at shell exit --- Etc/BUGS | 2 -- Src/builtin.c | 1 + Src/jobs.c | 12 ++++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'Src/builtin.c') diff --git a/Etc/BUGS b/Etc/BUGS index befae4477..e58fee721 100644 --- a/Etc/BUGS +++ b/Etc/BUGS @@ -48,8 +48,6 @@ related, probably obsolete, vared special case for $TERM set to "emacs". ------------------------------------------------------------------------ 47561: [PATCH v4] vcs_info: choose backend by basedir ------------------------------------------------------------------------ -39319: () { exit } =(:) doesn't clean up the tempfile ------------------------------------------------------------------------- 48091: Bug in compdescribe with matcher 'b:-=+' ------------------------------------------------------------------------ users/26071: Strange behavior about option completion of `git push #` diff --git a/Src/builtin.c b/Src/builtin.c index b93466ba5..1cef7cce8 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -5860,6 +5860,7 @@ zexit(int val, enum zexit_t from_where) /* send SIGHUP to any jobs left running */ killrunjobs(from_where == ZEXIT_SIGNAL); } + cleanfilelists(); if (isset(RCS) && interact) { if (!nohistsave) { int writeflags = HFILE_USE_OPTIONS; diff --git a/Src/jobs.c b/Src/jobs.c index 85d4c4d1f..a91ef787f 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -1366,6 +1366,18 @@ deletefilelist(LinkList file_list, int disowning) } } +/**/ +void +cleanfilelists(void) +{ + int i; + + DPUTS(shell_exiting >= 0, "BUG: cleanfilelists() before exit"); + + for (i = 1; i <= maxjob; i++) + deletefilelist(jobtab[i].filelist, 0); +} + /**/ void freejob(Job jn, int deleting) -- cgit v1.2.3