26072: lexsave()/lexrestore() to fix bug with sourcing from "funny" places

This commit is contained in:
Peter Stephenson 2009-03-09 15:57:57 +00:00
parent 6a2d06e5d9
commit 6f3f3c6a01
2 changed files with 9 additions and 1 deletions

View File

@ -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 $
*****************************************************

View File

@ -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();
}