Provides and conflicts with msys2-runtime, so can be used to replace it if wanted. Keep this as a separate package to test for regressions in cygwin and to have (in theory) a runtime that supports 32bit in the repo. There is no guarantee for how long we are going to keep this.
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
From 1a46b7d8d3d3359db09a81f063711e4523aedb68 Mon Sep 17 00:00:00 2001
|
|
From: Johannes Schindelin <johannes.schindelin@gmx.de>
|
|
Date: Tue, 8 Nov 2022 16:24:20 +0100
|
|
Subject: [PATCH 43/N] When converting to a Unix path, avoid double trailing
|
|
slashes
|
|
|
|
When calling `cygpath -u C:/msys64/` in an MSYS2 setup that was
|
|
installed into `C:/msys64/`, the result should be `/`, not `//`.
|
|
|
|
Let's ensure that we do not append another trailing slash if the
|
|
converted path already ends in a slash.
|
|
|
|
This fixes https://github.com/msys2/msys2-runtime/issues/112
|
|
|
|
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
|
---
|
|
winsup/cygwin/mount.cc | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
|
|
index 22d7b31..cbc3100 100644
|
|
--- a/winsup/cygwin/mount.cc
|
|
+++ b/winsup/cygwin/mount.cc
|
|
@@ -923,6 +923,9 @@ mount_info::conv_to_posix_path (const char *src_path, char *posix_path,
|
|
nextchar = 1;
|
|
|
|
int addslash = nextchar > 0 ? 1 : 0;
|
|
+ /* avoid appending a slash if the result already has a trailing slash */
|
|
+ if (append_slash && mi.posix_pathlen && mi.posix_path[mi.posix_pathlen-1] == '/')
|
|
+ append_slash = addslash = 0;
|
|
if ((mi.posix_pathlen + (pathbuflen - mi.native_pathlen) + addslash) >= NT_MAX_PATH)
|
|
return ENAMETOOLONG;
|
|
strcpy (posix_path, mi.posix_path);
|