Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] Redirect between two parameter assignments causes misbehaviour
- X-seq: zsh-workers 42110
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [BUG] Redirect between two parameter assignments causes misbehaviour
- Date: Mon, 11 Dec 2017 12:01:38 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20171211120142euoutp01219195f82908dd7d1770a84bd6e350e9~-O8G1IL_10063500635euoutp017
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1512993703; bh=8OxALAiwJ1izoRryViUj4E/uZ1EUGlamSSpp8X562AY=; h=Date:From:To:Subject:In-reply-to:References:From; b=J5JDuuQdINnnfXIWn3PIr02qSDrwZAzP7zWDiiqJ8WFYs+rVjTalCwBYteR8AjFvX AXgESXP+2kSNZi9FlAYy4Y9HYihZoh0WJ7XYaoHM5vCSRmy1mjIJoM7bT6YAAGd0Yl A6HouwByTDLAkLy0Uq0mqZ1kSjM/EAdOYRBWogDk=
- In-reply-to: <86CB677F-70BF-43B2-8F6D-E8F0AC4C43A3@dana.is>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CGME20171211001958epcas4p39fe7f2605374e3ea973e19b62beb9a9c@epcas4p3.samsung.com> <86CB677F-70BF-43B2-8F6D-E8F0AC4C43A3@dana.is>
On Sun, 10 Dec 2017 18:19:18 -0600
dana <dana@xxxxxxx> wrote:
> The following command produces no output (and returns with 0):
>
> % a=b 2> /dev/null c=d env
This is certainly documented to work.
As redirections at the start work OK I think the fix is as simple as
this.
diff --git a/Src/parse.c b/Src/parse.c
index 5fe3ebd..6af2550 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -1848,6 +1848,10 @@ par_simple(int *cmplx, int nr)
incmdpos = oldcmdpos;
isnull = 0;
assignments = 1;
+ } else if (IS_REDIROP(tok)) {
+ *cmplx = c = 1;
+ nr += par_redir(&r, NULL);
+ continue;
} else
break;
zshlex();
diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst
index cb82751..b8105cf 100644
--- a/Test/A04redirect.ztst
+++ b/Test/A04redirect.ztst
@@ -622,3 +622,10 @@
>FOO
>HERE
>}
+
+ a=b 2>/dev/null c=d
+ print $a
+ print $c
+0:Redirect in the middle of assignments
+>b
+>d
Messages sorted by:
Reverse Date,
Date,
Thread,
Author