Skip to content

Commit

Permalink
path-conversion: Introduce ability to switch off conversion.
Browse files Browse the repository at this point in the history
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: 마누엘 <nalla@hamal.uberspace.de>
  • Loading branch information
마누엘 authored and dscho committed May 6, 2022
1 parent d81dbf1 commit 2d391e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions winsup/cygwin/msys2_path_conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,14 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
return NONE;
}

/*
* Skip path mangling when environment indicates it.
*/
const char *no_pathconv = getenv ("MSYS_NO_PATHCONV");

if (no_pathconv)
goto skip_p2w;

/*
* Prevent Git's :file.txt and :/message syntax from beeing modified.
*/
Expand Down

0 comments on commit 2d391e8

Please sign in to comment.