From a03acf0ca2792562e3d7089b69763a3938b18769 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sat, 25 Aug 2001 16:43:31 +0000 Subject: Fix crash on re-entry to loop() from preprompt(). --- ChangeLog | 5 +++++ Src/init.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index db900e46c..fe575d919 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-08-25 Bart Schaefer + + * 15707: Src/init.c: Fix history crash caused by re-entering + loop() when the `precmd' shell function uses `source' or `.'. + 2001-08-24 Sven Wischnowsky * 15705: Src/Zle/complete.c: test if hash table pointer is NULL 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; } } -- cgit 1.4.1