Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-06-11 18:06:05 +0400
committerCorinna Vinschen <corinna@vinschen.de>2008-06-11 18:06:05 +0400
commit24790b9cdb14883782a5329c4be51db864d7d152 (patch)
treeb97e1b6274ccddd3193bc6665e492add144e7bd5
parentabe2834a4972c22f71e0a2d3ed336366a2526692 (diff)
* path.cc (get_nt_native_path): Drop considerations for DOS devices.
Keep relative paths relative. (cygwin_conv_path): Don't try to skip native NT prefixes on relative paths.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/path.cc15
2 files changed, 17 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f9d05101d..a68b4fb1c 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,12 @@
2008-06-11 Corinna Vinschen <corinna@vinschen.de>
+ * path.cc (get_nt_native_path): Drop considerations for DOS devices.
+ Keep relative paths relative.
+ (cygwin_conv_path): Don't try to skip native NT prefixes on relative
+ paths.
+
+2008-06-11 Corinna Vinschen <corinna@vinschen.de>
+
* include/cygwin/version.h (CYGWIN_VERSION_MOUNT_REGISTRY): Bump.
(CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME): Remove.
(CYGWIN_INFO_CYGDRIVE_FLAGS): Remove.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index eeb4b8495..0eeee8cd8 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -626,9 +626,10 @@ get_nt_native_path (const char *path, UNICODE_STRING& upath, bool managed)
upath.Length = 0;
if (path[0] == '/') /* special path w/o NT path representation. */
str2uni_cat (upath, path);
- else if (path[0] != '\\') /* X:\... or NUL, etc. */
+ else if (path[0] != '\\') /* X:\... or relative path. */
{
- str2uni_cat (upath, "\\??\\");
+ if (path[1] == ':') /* X:\... */
+ str2uni_cat (upath, "\\??\\");
str2uni_cat (upath, path);
transform_chars (&upath, 7, managed);
}
@@ -2832,9 +2833,13 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to,
PUNICODE_STRING up = p.get_nt_native_path ();
buf = tp.c_get ();
sys_wcstombs (buf, NT_MAX_PATH, up->Buffer, up->Length / sizeof (WCHAR));
- buf += 4; /* Skip \??\ */
- if (buf[1] != ':') /* native UNC path */
- *(buf += 2) = '\\';
+ /* Convert native path to standard DOS path. */
+ if (!strncmp (buf, "\\??\\", 4))
+ {
+ buf += 4;
+ if (buf[1] != ':') /* native UNC path */
+ *(buf += 2) = '\\';
+ }
lsiz = strlen (buf) + 1;
break;
case CCP_POSIX_TO_WIN_W: