zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Environment variables with nonstandard names are silently dropped on macOS
Date: Thu, 13 Jul 2017 16:13:30 -0700	[thread overview]
Message-ID: <CAH+w=7ZaReUDbV5e93bhHUr7imvfsvboF=1RZ9sWjHw-Y8yL6w@mail.gmail.com> (raw)
In-Reply-To: <CADB4rJGm=juEDoaNXouUJYnNNsh2ctM2sxa5sMaCfpdem0epfw@mail.gmail.com>

On Thu, Jul 13, 2017 at 2:07 PM, Radon Rosborough <radon.neon@gmail.com> wrote:
>
>     env FOO.BAR=QUUX zsh -c 'printenv FOO.BAR'
>
> In Zsh 5.2 on all operating systems, this prints QUUX. In Zsh 5.3.1 on
> macOS (but not elsewhere), it prints nothing and returns nonzero.
>
> The bug was introduced in commit 9dffe404a464289aedade8762795ee4d1bbb1d3f,
> which adds a special case for macOS pertaining to environment variable
> handling.

This patch merely changes one #define from config.h, to cause putenv()
to be used in place of setenv() -- there is no other code change.

Unfortunately discarding putenv() as well does not have any effect on
this, because "FOO.BAR" is not a valid identifier in zsh --- you can't
write ${FOO.BAR} without getting "zsh:1: bad substitution" -- and in
fact I don't see how it ever worked with setenv() either, because the
loop that imports the environment skips anything that doesn't match
zsh's definition of an identifier.


  reply	other threads:[~2017-07-13 23:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 21:07 Radon Rosborough
2017-07-13 23:13 ` Bart Schaefer [this message]
2017-07-13 23:35   ` Radon Rosborough

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='CAH+w=7ZaReUDbV5e93bhHUr7imvfsvboF=1RZ9sWjHw-Y8yL6w@mail.gmail.com' \
    --to=schaefer@brasslantern.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).