Skip to content

Commit 24df6e4

Browse files
committed
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 23846ef commit 24df6e4

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
@@ -1204,7 +1204,11 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
12041204
{
12051205
bool calc_tl = !no_envblock;
12061206
#ifdef __MSYS__
1207-
if (!keep_posix)
1207+
if (ascii_strncasematch(*srcp, "MSYS=", 5))
1208+
{
1209+
parse_options (*srcp + 5);
1210+
}
1211+
else if (!keep_posix)
12081212
{
12091213
/* Don't pass timezone environment to non-msys applications */
12101214
if (ascii_strncasematch(*srcp, "TZ=", 3))

0 commit comments

Comments
 (0)