File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ static void setup_environment(LPWSTR top_level_path, int full_path)
88
88
89
89
/* extend the PATH */
90
90
len = GetEnvironmentVariable (L"PATH" , NULL , 0 );
91
- len = sizeof (WCHAR ) * (len + 2 * MAX_PATH );
91
+ len = sizeof (WCHAR ) * (len + 3 * MAX_PATH );
92
92
path2 = (LPWSTR )malloc (len );
93
93
wcscpy (path2 , top_level_path );
94
94
if (!full_path )
@@ -97,9 +97,16 @@ static void setup_environment(LPWSTR top_level_path, int full_path)
97
97
PathAppend (path2 , msystem_bin );
98
98
if (_waccess (path2 , 0 ) != -1 ) {
99
99
/* We are in an MSys2-based setup */
100
+ int len2 = GetEnvironmentVariable (L"HOME" , NULL , 0 );
101
+
100
102
wcscat (path2 , L";" );
101
103
wcscat (path2 , top_level_path );
102
104
PathAppend (path2 , L"usr\\bin;" );
105
+ if (len2 + 6 < MAX_PATH ) {
106
+ GetEnvironmentVariable (L"HOME" ,
107
+ path2 + wcslen (path2 ), len2 );
108
+ PathAppend (path2 , L"bin;" );
109
+ }
103
110
}
104
111
else {
105
112
/* Fall back to MSys1 paths */
You can’t perform that action at this time.
0 commit comments