about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-03-09 15:57:57 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-03-09 15:57:57 +0000
commit6f3f3c6a010c43881b394cbb60c5f4938a8f43b3 (patch)
tree49fb95e8c7c2eda3cb78cecc86b737addbc3588b
parent6a2d06e5d96f13d8b754c613d8129bce51455321 (diff)
downloadzsh-6f3f3c6a010c43881b394cbb60c5f4938a8f43b3.tar.gz
zsh-6f3f3c6a010c43881b394cbb60c5f4938a8f43b3.tar.xz
zsh-6f3f3c6a010c43881b394cbb60c5f4938a8f43b3.zip
26072: lexsave()/lexrestore() to fix bug with sourcing from "funny" places
-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();
 }