about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2008-11-12 12:57:25 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2008-11-12 12:57:25 +0000
commit61e9152b112b22ee145d4775d7df7ed9a6ed8329 (patch)
tree27e6e3fd64f7b84cca9c72e2e406ee1a347195e4 /Src
parent18f9bf0a36e9865778873b007b7c73849c5d75b3 (diff)
downloadzsh-61e9152b112b22ee145d4775d7df7ed9a6ed8329.tar.gz
zsh-61e9152b112b22ee145d4775d7df7ed9a6ed8329.tar.xz
zsh-61e9152b112b22ee145d4775d7df7ed9a6ed8329.zip
26028: close temporary file when aborting fc
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 0748eaccc..72c519037 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1480,6 +1480,7 @@ bin_fc(char *nam, char **argv, Options ops, int func)
 		    unqueue_signals();
 		    zwarnnam("fc",
 		      "current history line would recurse endlessly, aborted");
+		    fclose(out);
 		    unlink(fil);
 		    return 1;
 		}
@@ -1619,6 +1620,8 @@ fclist(FILE *f, Options ops, zlong first, zlong last,
 	    zwarnnam("fc", "no such event: %s", buf);
 	} else
 	    zwarnnam("fc", "no events in that range");
+	if (f != stdout)
+	    fclose(f);
 	return 1;
     }