Subject: Re: leading '=' in enviroment variable truncated
From: Peter Stephenson <[email-masked]>
To: [email-masked]
Date: Sun, 8 May 2016 20:12:17 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Sun, 8 May 2016 10:59:49 -0700
Bart Schaefer <[email-masked]> wrote:

> On May 7,  4:21pm, Jacob Lowe wrote:
> }
> } https://github.com/motdotla/dotenv/issues/140
> } 
> } TEST='=FOO' node -e 'console.log(process.env.TEST)'
> } 
> } This spits out "FOO" with no leading "=".
> 
> As mentioned in the dotenv issue, this happens only on OSX.  I've just
> confirmed that it's a problem either with the library implementations
> of setenv() / unsetenv(), or with zsh's use of them.  If I comment out
> HAVE_SETENV / HAVE_UNSETENV from config.h and rebuild zsh, I am no
> longer able to reproduce the problem.

This appears to be a feature.

https://developer.apple.com/library/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man3/setenv.3.html

  These functions set, unset and fetch environment variables from the host
  environment list.  For compatibility with differing environment
  conven-tions, conventions, the given arguments name and value may be
  appended and prepended, respectively, with an equal sign ``=''.

Very useful, if I may say so.

pws