Skip to content

Commit

Permalink
build_env(): respect the MSYS environment variable
Browse files Browse the repository at this point in the history
With this commit, you can call

	MSYS=noemptyenvvalues my-command

and it does what is expected: to pass no empty-valued environment
variables to `my-command`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Feb 11, 2024
1 parent 9cdf657 commit 8f9faea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion winsup/cygwin/environ.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,11 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
{
bool calc_tl = !no_envblock;
#ifdef __MSYS__
if (!keep_posix)
if (ascii_strncasematch(*srcp, "MSYS=", 5))
{
parse_options (*srcp + 5);
}
else if (!keep_posix)
{
/* Don't pass timezone environment to non-msys applications */
if (ascii_strncasematch(*srcp, "TZ=", 3))
Expand Down

0 comments on commit 8f9faea

Please sign in to comment.