diff --git a/winsup/cygwin/msys2_path_conv.cc b/winsup/cygwin/msys2_path_conv.cc index 965f0316f9..7b1312ac5c 100644 --- a/winsup/cygwin/msys2_path_conv.cc +++ b/winsup/cygwin/msys2_path_conv.cc @@ -455,6 +455,8 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en int starts_with_minus = 0; int starts_with_minus_alpha = 0; + int only_dots = *it == '.'; + int has_slashes = 0; if (*it == '-') { starts_with_minus = 1; it += 1; @@ -498,11 +500,17 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en if (ch == '/' && *(it2 + 1) == '/') { return URL; } else { + if (!only_dots && !has_slashes) + goto skip_p2w; return POSIX_PATH_LIST; } } else if (memchr(it2, '=', end - it) == NULL) { return SIMPLE_WINDOWS_PATH; } + } else if (ch != '.') { + only_dots = 0; + if (ch == '/' || ch == '\\') + has_slashes = 1; } }