about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-08-25 16:43:31 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-08-25 16:43:31 +0000
commita03acf0ca2792562e3d7089b69763a3938b18769 (patch)
treedcc4400a8d4757d14ea2fe654b5b1b78a03af011 /Src
parent55738a79cabeabcec9d245051079e5d74b47e717 (diff)
downloadzsh-a03acf0ca2792562e3d7089b69763a3938b18769.tar.gz
zsh-a03acf0ca2792562e3d7089b69763a3938b18769.tar.xz
zsh-a03acf0ca2792562e3d7089b69763a3938b18769.zip
Fix crash on re-entry to loop() from preprompt().
Diffstat (limited to 'Src')
-rw-r--r--Src/init.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Src/init.c b/Src/init.c
index cbfaf5ad0..5a86800d1 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -107,6 +107,8 @@ loop(int toplevel, int justonce)
     pushheap();
     for (;;) {
 	freeheap();
+	if (stophist == 3)	/* re-entry via preprompt() */
+	    hend(NULL);
 	hbegin(1);		/* init history mech        */
 	if (isset(SHINSTDIN)) {
 	    setblock_stdin();
@@ -114,7 +116,10 @@ loop(int toplevel, int justonce)
 	        int hstop = stophist;
 		stophist = 3;
 		preprompt();
-		stophist = hstop;
+		if (stophist != 3)
+		    hbegin(1);
+		else
+		    stophist = hstop;
 		errflag = 0;
 	    }
 	}