Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with push-line-or-edit and here-documents
- X-seq: zsh-workers 9900
 
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
 
- To: zsh-workers@xxxxxxxxxxxxxx
 
- Subject: Re: Bug with push-line-or-edit and here-documents
 
- Date: Mon, 28 Feb 2000 12:00:41 +0100 (MET)
 
- In-reply-to: "Bart Schaefer"'s message of Sat, 26 Feb 2000 17:48:18 +0000
 
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
 
Bart Schaefer wrote:
> push-line-or-edit with a here-document is accepting the command rather than
> just pushing it on the editor stack.
> 
> zagzig[21] cat <<EOF
> heredoc> echo this should not be catted
> heredoc> <ESC-q>
> echo this should not be catted			<-- Yipes, "cat" ran!
> zagzig[21] cat <<EOF
> echo this should not be catted
lexrestore() called from parsestr() resets errflag.
Bye
 Sven
diff -ru ../z.old/Src/exec.c Src/exec.c
--- ../z.old/Src/exec.c	Mon Feb 28 10:49:44 2000
+++ Src/exec.c	Mon Feb 28 11:59:21 2000
@@ -2553,8 +2553,12 @@
     if (t > buf && t[-1] == '\n')
 	t--;
     *t = '\0';
-    if (!qt)
+    if (!qt) {
+	int ef = errflag;
+
 	parsestr(buf);
+	errflag = ef;
+    }
     s = dupstring(buf);
     zfree(buf, bsiz);
     return s;
--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author