From 2348e4f3c61775ad596456bde503f6ae2387cba0 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 11 Nov 2008 11:45:05 +0000 Subject: [PATCH] * mount.cc (mount_info::cygdrive_win32_path): Always upper case DOS drive letter to accommodate case sensitivity. (cygdrive_getmntent): Ditto. * path.cc (path_conv::check): Invalidate wide_path after making path relative. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/mount.cc | 5 +++-- winsup/cygwin/path.cc | 9 ++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 607d6af90..1a2159441 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2008-11-11 Corinna Vinschen + + * mount.cc (mount_info::cygdrive_win32_path): Always upper case + DOS drive letter to accommodate case sensitivity. + (cygdrive_getmntent): Ditto. + * path.cc (path_conv::check): Invalidate wide_path after making path + relative. + 2008-11-11 Corinna Vinschen * environ.cc (create_upcaseenv): New static variable. diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc index 2ba459956..d070788c0 100644 --- a/winsup/cygwin/mount.cc +++ b/winsup/cygwin/mount.cc @@ -403,7 +403,8 @@ mount_info::cygdrive_win32_path (const char *src, char *dst, int& unit) } else { - dst[0] = cyg_tolower (*p); + /* drive letter must always be uppercase for casesensitive native NT. */ + dst[0] = cyg_toupper (*p); dst[1] = ':'; strcpy (dst + 2, p + 1); backslashify (dst, dst, !dst[2]); @@ -1211,7 +1212,7 @@ cygdrive_getmntent () if (_my_tls.locals.available_drives & mask) break; - __small_sprintf (native_path, "%c:\\", drive); + __small_sprintf (native_path, "%c:\\", cyg_toupper (drive)); if (GetFileAttributes (native_path) == INVALID_FILE_ATTRIBUTES) { _my_tls.locals.available_drives &= ~mask; diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index d0eab0298..265712fdb 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1231,7 +1231,14 @@ out: if (opt & PC_NOFULL) { if (is_relpath) - mkrelpath (this->path, !!caseinsensitive); + { + mkrelpath (this->path, !!caseinsensitive); + /* Invalidate wide_path so that wide relpath can be created + in later calls to get_nt_native_path or get_wide_win32_path. */ + if (wide_path) + cfree (wide_path); + wide_path = NULL; + } if (need_directory) { size_t n = strlen (this->path);