From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7757 invoked from network); 8 Jul 1999 15:51:04 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Jul 1999 15:51:04 -0000 Received: (qmail 16148 invoked by alias); 8 Jul 1999 15:50:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7049 Received: (qmail 16141 invoked from network); 8 Jul 1999 15:50:56 -0000 Message-Id: <9907081522.AA21805@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: pws-25: eval bug Date: Thu, 08 Jul 1999 17:22:14 +0200 From: Peter Stephenson 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 Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy