Files
MSYS2-packages/msys2-runtime-3.3/0035-Handle-ORIGINAL_PATH-just-like-PATH.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

49 lines
2.4 KiB
Diff

From 7af6781845542e53a96def2997912f68537202e8 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 21 Mar 2017 13:18:38 +0100
Subject: [PATCH 35/N] Handle ORIGINAL_PATH just like PATH
MSYS2 recently introduced that hack where the ORIGINAL_PATH variable is
set to the original PATH value in /etc/profile, unless previously set.
In Git for Windows' default mode, that ORIGINAL_PATH value is the used
to define the PATH variable explicitly.
So far so good.
The problem: when calling from inside an MSYS2 process (such as Bash) a
MINGW executable (such as git.exe) that then calls another MSYS2
executable (such as bash.exe), that latter call will try to re-convert
ORIGINAL_PATH after the previous call converted ORIGINAL_PATH from POSIX
to Windows paths. And this conversion may very well fail, e.g. when the
path list contains mixed semicolons and colons.
So let's just *force* the MSYS2 runtime to handle ORIGINAL_PATH in the
same way as the PATH variable (which conversion works, as we know).
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/environ.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 5c197a6..5afac8d 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -327,6 +327,7 @@ static win_env conv_envvars[] =
{NL ("HOME="), NULL, NULL, env_path_to_posix, env_path_to_win32, false},
{NL ("LD_LIBRARY_PATH="), NULL, NULL,
env_plist_to_posix, env_plist_to_win32, true},
+ {NL ("ORIGINAL_PATH="), NULL, NULL, env_PATH_to_posix, env_plist_to_win32, true},
{NL ("SHELL="), NULL, NULL, env_path_to_posix, env_path_to_win32, true, true},
{NL ("TMPDIR="), NULL, NULL, env_path_to_posix, env_path_to_win32, false},
{NL ("TMP="), NULL, NULL, env_path_to_posix, env_path_to_win32, false},
@@ -353,7 +354,7 @@ static const unsigned char conv_start_chars[256] =
0, 0, 0, 0, 0, 0, 0, 0,
/* 72 */
/* H I J K L M N O */
- WC, 0, 0, 0, WC, 0, 0, 0,
+ WC, 0, 0, 0, WC, 0, 0, WC,
/* 80 */
/* P Q R S T U V W */
WC, 0, 0, WC, WC, 0, 0, 0,