Skip to content

Commit 03579b3

Browse files
마누엘dscho
마누엘
authored andcommitted
path-conversion: Introduce ability to switch off conversion.
When calling windows native apps from MSYS2, the runtime tries to convert commandline arguments by a specific set of rules. See [MinGW wiki] (http://www.mingw.org/wiki/Posix_path_conversion). If the user does not want that behavior on a big scale, e.g. inside a bash script, the user can now set the the environment variable `MSYS_NO_PATHCONV` when calling native windows commands. Signed-off-by: 마누엘 <[email protected]>
1 parent 5001f40 commit 03579b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

winsup/cygwin/msys2_path_conv.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
347347
return NONE;
348348
}
349349

350+
/*
351+
* Skip path mangling when environment indicates it.
352+
*/
353+
const char *no_pathconv = getenv ("MSYS_NO_PATHCONV");
354+
355+
if (no_pathconv)
356+
goto skip_p2w;
357+
350358
/*
351359
* Prevent Git's :file.txt and :/message syntax from beeing modified.
352360
*/

0 commit comments

Comments
 (0)