From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: "VAR=foo export VAR" no longer works in zsh emulation
Date: Tue, 24 Jan 2017 17:52:58 +0000 [thread overview]
Message-ID: <20170124175258.78b0554e@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <alpine.LRH.2.00.1701240841240.4560@toltec.zanshin.com>
On Tue, 24 Jan 2017 08:42:14 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Tue, 24 Jan 2017, Bart Schaefer wrote:
>
> > > Do you have POSIX_BUILTINS set?
> >
> > Evidently "emulate sh" does not set that and needs to?
>
> Sorry, I've got that backwards. Apparently one did not need to set that
> before, and now one does?
It looks up to 5.2 you don't need the option, and this changed in the
commit below.
So it's less sh compatibility, as it still works there, and more
backward compatilibity in zsh.
pws
commit c8de0af35935602370cc79193d0e0d53971250d4
Author: Barton E. Schaefer <schaefer@zsh.org>
Date: Mon Sep 19 00:25:13 2016 -0700
39381: handle save/restore of variable values when "typeset"-related reserved words are prefixed by an assignment
diff --git a/ChangeLog b/ChangeLog
index e92c7b2..f9592dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-09-19 Barton E. Schaefer <schaefer@zsh.org>
+
+ * 39381: Src/exec.c: handle save/restore of variable values when
+ "typeset"-related reserved words are prefixed by an assignment
+
2016-09-19 Mikael Magnusson <mikachu@gmail.com>
* 39351: Functions/Zle/bracketed-paste-url-magic: Handle magnet
diff --git a/Src/exec.c b/Src/exec.c
index 9a7234e..d924148 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3543,7 +3543,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
* if it's got "command" in front.
* If it's a normal command --- save.
*/
- if (is_shfunc || (hn->flags & BINF_PSPECIAL))
+ if (is_shfunc || (hn->flags & (BINF_PSPECIAL|BINF_ASSIGN)))
do_save = (orig_cflags & BINF_COMMAND);
else
do_save = 1;
@@ -3552,7 +3552,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
* Save if it's got "command" in front or it's
* not a magic-equals assignment.
*/
- if ((cflags & BINF_COMMAND) || !assign)
+ if ((cflags & (BINF_COMMAND|BINF_ASSIGN)) || !assign)
do_save = 1;
}
if (do_save && varspc)
next prev parent reply other threads:[~2017-01-24 18:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170124135040eucas1p11db129a17c1993a5b2d428ef9401bbf9@eucas1p1.samsung.com>
2017-01-24 13:50 ` Fw: " Peter Stephenson
[not found] ` <CGME20170124163239eucas1p1a2fc806430fa49f6e0c9ec83fe42b676@eucas1p1.samsung.com>
2017-01-24 16:32 ` Peter Stephenson
2017-01-24 16:34 ` Bart Schaefer
2017-01-24 16:42 ` Bart Schaefer
2017-01-24 17:52 ` Peter Stephenson [this message]
2017-01-24 22:24 ` Bart Schaefer
2017-01-24 16:44 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170124175258.78b0554e@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).