Skip to content

Commit bce9e93

Browse files
dscholazka
authored andcommitted
build_env(): respect the MSYS environment variable
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]>
1 parent 107567f commit bce9e93

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

winsup/cygwin/environ.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,11 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
12031203
{
12041204
bool calc_tl = !no_envblock;
12051205
#ifdef __MSYS__
1206-
if (!keep_posix)
1206+
if (ascii_strncasematch(*srcp, "MSYS=", 5))
1207+
{
1208+
parse_options (*srcp + 5);
1209+
}
1210+
else if (!keep_posix)
12071211
{
12081212
/* Don't pass timezone environment to non-msys applications */
12091213
if (ascii_strncasematch(*srcp, "TZ=", 3))

0 commit comments

Comments
 (0)