Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Environment variables with nonstandard names are silently dropped on macOS



Hi all,

I recently upgraded from Zsh 5.2 to Zsh 5.3.1, and found that Zsh has
acquired a habit of silently dropping environment variables that have
"nonstandard" names (e.g. they contain periods). The test case to reproduce
is:

    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. The patch was designed to fix a more serious bug, namely that
leading equals signs were trimmed in environment variable *values*, but
unfortunately it also introduced this one.

I couldn't find any reference to the issue online, so I thought I would
bring it up here. I don't have the time or skills to contribute a fix,
unfortunately.

Best,
Radon Rosborough


Messages sorted by: Reverse Date, Date, Thread, Author