diff options
author | Christopher Faylor <me@cgf.cx> | 2000-05-30 21:24:50 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-05-30 21:24:50 +0000 |
commit | ca8a0f8fb217d387a189a5b534dc14bb2a60f06e (patch) | |
tree | badfef35b8a1f72e827312a2fb29ce84f5f12ec7 /winsup | |
parent | d2dd57657cb7aa40e7020c0b825345647d4514aa (diff) | |
download | newlib-ca8a0f8fb217d387a189a5b534dc14bb2a60f06e.zip newlib-ca8a0f8fb217d387a189a5b534dc14bb2a60f06e.tar.gz newlib-ca8a0f8fb217d387a189a5b534dc14bb2a60f06e.tar.bz2 |
* path.cc (mount_info::conv_to_win32_path): Previous patch was too aggressive
in adding a trailing slash.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7d59097..b8aa5b9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Tue May 30 16:58:33 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::conv_to_win32_path): Previous patch was too + aggressive in adding a trailing slash. + Mon May 29 20:31:01 2000 Christopher Faylor <cgf@cygnus.com> * Makefile.in: Remove libadvapi32.a. @@ -73,7 +78,7 @@ Wed May 24 21:59:00 2000 Corinna Vinschen <corinna@vinschen.de> * syscalls.cc (_cygwin_istext_for_stdio): New, for newlib * include/cygwin/version.h: Bump API number for detect old programs using old getc/putc macros - + 2000-05-23 DJ Delorie <dj@cygnus.com> * dir.cc (writable_directory): handle root directories diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 4cb2636..d3bc76c 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: */ |