Skip to content

Commit 707f9b2

Browse files
committed
Leave arguments starting with a tilde or quote alone
It is not a good idea to expand, say, ~/.gitconfig partially: replacing it by ~C:\msys64\.gitconfig is most likely the wrong thing to do! Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 78fbdbb commit 707f9b2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

winsup/cygwin/msys2_path_conv.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,13 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
341341

342342
if (*it == '\0' || it == end) return NONE;
343343

344+
/* Let's not convert ~/.file to ~C:\msys64\.file */
345+
if (*it == '~') {
346+
skip_p2w:
347+
*src = end;
348+
return NONE;
349+
}
350+
344351
while (!isalnum(*it) && *it != '/' && *it != '\\' && *it != ':' && *it != '-' && *it != '.') {
345352
recurse = true;
346353
it = ++*src;

0 commit comments

Comments
 (0)