zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug with push-line-or-edit and here-documents
@ 2000-02-28 11:57 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2000-02-28 11:57 UTC (permalink / raw)
  To: zsh-workers


I wrote:

> ...
>
> -    if (!qt)
> +    if (!qt) {
> +	int ef = errflag;
> +
>  	parsestr(buf);
> +	errflag = ef;
> +    }

Err... we better keep a value != zero coming from parsestr().

Bye
 Sven

diff -ru ../z.old/Src/exec.c Src/exec.c
--- ../z.old/Src/exec.c	Mon Feb 28 12:00:51 2000
+++ Src/exec.c	Mon Feb 28 12:56:24 2000
@@ -2557,7 +2557,9 @@
 	int ef = errflag;
 
 	parsestr(buf);
-	errflag = ef;
+
+	if (!errflag)
+	    errflag = ef;
     }
     s = dupstring(buf);
     zfree(buf, bsiz);

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug with push-line-or-edit and here-documents
@ 2000-02-28 11:00 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2000-02-28 11:00 UTC (permalink / raw)
  To: zsh-workers


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@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Bug with push-line-or-edit and here-documents
@ 2000-02-26 17:48 Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2000-02-26 17:48 UTC (permalink / raw)
  To: zsh-workers

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

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-02-28 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-28 11:57 Bug with push-line-or-edit and here-documents Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-02-28 11:00 Sven Wischnowsky
2000-02-26 17:48 Bart Schaefer

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).