From 0e7d0755a911149d0c517c6b93887b3155a9cfe0 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 21 Nov 2023 09:24:03 +0100 Subject: [PATCH] fixup! Add functionality for converting UNIX paths in arguments and environment variables to Windows form for native Win32 applications. Don't memchr behind end, it+1 --- winsup/cygwin/msys2_path_conv.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/winsup/cygwin/msys2_path_conv.cc b/winsup/cygwin/msys2_path_conv.cc index 2bdf0ae949..d4f0192bf6 100644 --- a/winsup/cygwin/msys2_path_conv.cc +++ b/winsup/cygwin/msys2_path_conv.cc @@ -349,6 +349,13 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en path_type result = NONE; + if (it + 1 == end) { + switch (*it) { + case '/': return ROOTED_PATH ; + default: return SIMPLE_WINDOWS_PATH; + } + } + if (isalpha(*it) && *(it + 1) == ':') { if (*(it + 2) == '\\') { return SIMPLE_WINDOWS_PATH;