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 <[email protected]>
  • Loading branch information
dscho authored and lazka committed Jun 18, 2023
1 parent 0a4800c commit c3f0426
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 @@ -1203,7 +1203,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 c3f0426

Please sign in to comment.