Skip to content

Commit

Permalink
Leave arguments starting with a tilde or quote alone
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dscho committed Aug 23, 2015
1 parent 984c0eb commit 6804f2a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions winsup/cygwin/msys2_path_conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,13 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en

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

/* Let's not convert ~/.file to ~C:\msys64\.file */
if (*it == '~') {
skip_p2w:
*src = end;
return NONE;
}

while (!isalnum(*it) && *it != '/' && *it != '\\' && *it != ':' && *it != '-' && *it != '.') {
recurse = true;
it = ++*src;
Expand Down

0 comments on commit 6804f2a

Please sign in to comment.