MSYS2-packages/msys2-runtime/0034-build_env-respect-the-MSYS-environment-variable.patch
Johannes Schindelin 6365cf1bc0 msys2-runtime: upgrade to v3.6.5
This corresponds to https://github.com/msys2/msys2-runtime/pull/313

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2025-10-10 16:28:18 +02:00

35 lines
1.1 KiB
Diff

From 9bf14b59a047b0af4e472f2467576f2095428809 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 6 Sep 2022 12:18:18 +0200
Subject: [PATCH 34/N] 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 <johannes.schindelin@gmx.de>
---
winsup/cygwin/environ.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 12b4d57..4e04921 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -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))