summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2022-04-30 11:21:03 -0700
committerBart Schaefer <schaefer@zsh.org>2022-04-30 11:21:03 -0700
commite127ceaae87414588d4c839fc4cc04f02c2ed8c5 (patch)
tree32afeea362f1961770bd3086b537bbb8f8fa4fa9 /Src
parent8181708feb35c647aa9b9692875a1ebf893ade6b (diff)
downloadzsh-e127ceaae87414588d4c839fc4cc04f02c2ed8c5.tar.gz
zsh-e127ceaae87414588d4c839fc4cc04f02c2ed8c5.zip
50149: Remove all remaining =(...) files at shell exit
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c1
-rw-r--r--Src/jobs.c12
2 files changed, 13 insertions, 0 deletions
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
@@ -1368,6 +1368,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)
{
struct process *pn, *nx;