From ca8a0f8fb217d387a189a5b534dc14bb2a60f06e Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 30 May 2000 21:24:50 +0000 Subject: * path.cc (mount_info::conv_to_win32_path): Previous patch was too aggressive in adding a trailing slash. --- winsup/cygwin/path.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 4cb26369f..d3bc76c19 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1020,12 +1020,14 @@ mount_info::conv_to_win32_path (const char *src_path, char *win32_path, else { int n = mi->native_pathlen; - memcpy (dst, mi->native_path, n); + memcpy (dst, mi->native_path, n + 1); char *p = pathbuf + mi->posix_pathlen; - if (!trailing_slash_p && isdrive (mi->native_path) && !mi->native_path[2]) - trailing_slash_p = 1; if (!trailing_slash_p && !*p) - dst[n] = '\0'; + { + if (isdrive (dst) && !dst[2]) + dst[n++] = '\\'; + dst[n] = '\0'; + } else { /* Do not add trailing \ to UNC device names like \\.\a: */ -- cgit v1.2.3