From e03e3745678892ef2d2060be4ba7b17f5b08c88c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 22 Feb 2015 18:33:48 +0100 Subject: [PATCH] Leave paths containing any special characters alone Signed-off-by: Johannes Schindelin --- winsup/cygwin/msys2_path_conv.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/winsup/cygwin/msys2_path_conv.cc b/winsup/cygwin/msys2_path_conv.cc index f112fa4258..72e06d45f6 100644 --- a/winsup/cygwin/msys2_path_conv.cc +++ b/winsup/cygwin/msys2_path_conv.cc @@ -354,6 +354,20 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en if (*it == ':') goto skip_p2w; + while (it != end && *it) { + switch (*it) { + case '`': + case '\'': + case '"': + case '*': + case '?': + case '[': + case ']': + goto skip_p2w; + ++it; + } + it = *src; + while (!isalnum(*it) && *it != '/' && *it != '\\' && *it != ':' && *it != '-' && *it != '.') { recurse = true; it = ++*src;