MSYS2-packages/msys2-runtime-3.3/0040-build_env-respect-the-MSYS-environment-variable.patch
Christoph Reiter 743bae3086 Add msys2-runtime-3.3
Provides and conflicts with msys2-runtime, so can be used to replace it if wanted.

Keep this as a separate package to test for regressions in cygwin
and to have (in theory) a runtime that supports 32bit in the repo.

There is no guarantee for how long we are going to keep this.
2022-12-09 17:58:25 +01:00

35 lines
1.1 KiB
Diff

From 97c2d7fa8bb424012aad77b8d86f3262a35fab0a 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 40/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 128f34d..b431d3c 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -1217,7 +1217,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))