about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Src/init.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 54c9f62fb..ee5fec451 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-03-09  Peter Stephenson  <pws@csr.com>
 
+	* 26702: Src/init.c: lexsave()/lexrestore() needed around
+	use of history in loop() when not at top level; shows up
+	when calling things from zle, for example.
+
 	* derf@sievert.tabularazor.org: 22701:
 	Completion/Unix/Command/_devtodo: new completion
 
@@ -11357,5 +11361,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4605 $                         
+* $Revision: 1.4606 $                         
 *****************************************************
diff --git a/Src/init.c b/Src/init.c
index 2c059ffc2..a3aac3e1c 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -105,6 +105,8 @@ loop(int toplevel, int justonce)
     Eprog prog;
 
     pushheap();
+    if (!toplevel)
+	lexsave();
     for (;;) {
 	freeheap();
 	if (stophist == 3)	/* re-entry via preprompt() */
@@ -199,6 +201,8 @@ loop(int toplevel, int justonce)
 	if (justonce)
 	    break;
     }
+    if (!toplevel)
+	lexrestore();
     popheap();
 }