Skip to content

Commit 12fc343

Browse files
lazkadscho
authored andcommitted
msys2_path_conv: pass PC_NOFULL to path_conv
In theory this doesn't make a difference because posix_to_win32_path() is only called with rooted/absolute paths, but as pointed out in #103 PC_NOFULL will preserve the trailing slash of unix paths (for some reason). See "cygpath -m /bin/" (preserved) vs "cygpath -am /bin/" (dropped) One use case where we need to trailing slashes to be preserved is the GCC build system: https://github.com/gcc-mirror/gcc/blob/6d82e0fea5f988e829912a/gcc/Makefile.in#L2314 The Makefile appends a slash to the prefixes and the C code doing relocation will treat the path as a directory if there is a trailing slash. See msys2/MINGW-packages#14173 for details. With this change all our MSYS2 path_conv tests pass again.
1 parent 11a478c commit 12fc343

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

winsup/cygwin/msys2_path_conv.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ void posix_to_win32_path(const char* from, const char* to, char** dst, const cha
682682
strncpy(one_path, from, to-from);
683683
one_path[to-from] = '\0';
684684

685-
path_conv conv (one_path, 0);
685+
path_conv conv (one_path, PC_NOFULL);
686686
if (conv.error)
687687
{
688688
set_errno(conv.error);

0 commit comments

Comments
 (0)