MSYS2-packages/msys2-runtime-3.3/0048-fixup-Add-functionality-for-converting-UNIX-paths-in.patch

31 lines
1.0 KiB
Diff

From b9149f75436c8a912e3edbcae9f66324e596f151 Mon Sep 17 00:00:00 2001
From: Kai Pastor <dg0yt@darc.de>
Date: Tue, 21 Nov 2023 09:24:03 +0100
Subject: [PATCH 48/N] 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 ebf47d6..e6f8f7c 100644
--- a/winsup/cygwin/msys2_path_conv.cc
+++ b/winsup/cygwin/msys2_path_conv.cc
@@ -346,6 +346,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;