Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug with push-line-or-edit and here-documents



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