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>2009-12-21 19:44:37 +0300
committerCorinna Vinschen <corinna@vinschen.de>2009-12-21 19:44:37 +0300
commit59cb363a5fd02adf32fca81380c6f438d8b75615 (patch)
tree792ed4b3b75503f478a8e63563b07bafaea8a425 /winsup/cygwin
parent6d63272b5312cd145f034ccd573f275d2ea7ecc2 (diff)
* path.cc (cygwin_conv_path): Add band-aid including comment to avoid
conversion from POSIX "." to Win32 ".\\".
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/path.cc21
2 files changed, 25 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 77bc8618f..385115af4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2009-12-21 Corinna Vinschen <corinna@vinschen.de>
+ * path.cc (cygwin_conv_path): Add band-aid including comment to avoid
+ conversion from POSIX "." to Win32 ".\\".
+
+2009-12-21 Corinna Vinschen <corinna@vinschen.de>
+
* exec.cc (execvp): Call find_exec with FE_NNF flag to enforce
a NULL return when executable isn't found in $PATH. Convert NULL
to "".
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 6238f2bce..bd3463d88 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2709,6 +2709,16 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to,
*(buf += 2) = '\\';
}
lsiz = strlen (buf) + 1;
+ /* TODO: Incoming "." is a special case which leads to a trailing
+ backslash ".\\" in the Win32 path. That's a result of the
+ conversion in normalize_posix_path. This should not occur
+ so the below code is just a band-aid. */
+ if (!strcmp ((const char *) from, ".") && relative
+ && !strcmp (buf, ".\\"))
+ {
+ --lsiz;
+ buf[lsiz - 1] = '\0';
+ }
}
break;
case CCP_POSIX_TO_WIN_W:
@@ -2727,7 +2737,16 @@ cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to,
if (p.error)
return_with_errno (p.error);
}
- lsiz = (p.get_wide_win32_path_len () + 1) * sizeof (WCHAR);
+ lsiz = p.get_wide_win32_path_len () + 1;
+ /* TODO: Same ".\\" band-aid as in CCP_POSIX_TO_WIN_A case. */
+ if (!strcmp ((const char *) from, ".") && relative
+ && !wcscmp (p.get_nt_native_path ()->Buffer, L".\\"))
+ {
+ --lsiz;
+ p.get_nt_native_path ()->Length -= sizeof (WCHAR);
+ p.get_nt_native_path ()->Buffer[lsiz - 1] = L'\0';
+ }
+ lsiz *= sizeof (WCHAR);
break;
case CCP_WIN_A_TO_POSIX:
buf = tp.c_get ();