* PATCH: pws-25: eval bug
@ 1999-07-08 15:22 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-07-08 15:22 UTC (permalink / raw)
To: Zsh hackers list
The eval builtin didn't save and restore the lexical state (really the
history state, but they're bound up together). This showed up when I added
an eval to insert-files, which fixed the problem with parentheses I
mentioned yesterday, but caused the curious side-effect that although the
function seemed to run OK, hitting return on the generated command line
behaved as if it had got EOF. This was because stophist was set to 2 to
read the eval string, and never got put back. There were probably other
history effects, too.
I presume it's as simple as getting bin_eval() to use parse_string(), which
is there for that purpose, and does almost exactly what bin_eval() was
doing except that it restores the state properly. Can anyone think of a
good reason why eval wasn't using parse_string() already?
Maybe this is needed in 3.0.6, although the problem would have to show up
in a different place.
--- Src/builtin.c.eval Wed Jul 7 13:33:01 1999
+++ Src/builtin.c Thu Jul 8 17:07:24 1999
@@ -3208,11 +3208,7 @@
{
List list;
- inpush(zjoin(argv, ' '), 0, NULL);
- strinbeg(0);
- list = parse_list();
- strinend();
- inpop();
+ list = parse_string(zjoin(argv, ' '), 0);
if (!list) {
errflag = 0;
return 1;
--
Peter Stephenson <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-07-08 15:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-08 15:22 PATCH: pws-25: eval bug Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).