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>2011-02-15 13:31:54 +0300
committerCorinna Vinschen <corinna@vinschen.de>2011-02-15 13:31:54 +0300
commit2908e3eb8093cbd3903316a307745d99c42ff250 (patch)
tree213e6fdf3a67bb635398879c0df24b740f3d52de /winsup/cygwin/fhandler_disk_file.cc
parent4655360348c02af0f2be963fcaf23d4916ceb0dd (diff)
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Use POSIX
path to check for symlink.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index cc2c23731..a1ae8c184 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -1829,20 +1829,12 @@ fhandler_disk_file::readdir_helper (DIR *dir, dirent *de, DWORD w32_err,
if (RtlEqualUnicodeString (&uname, &ro_u_lnk, TRUE))
{
tmp_pathbuf tp;
- UNICODE_STRING fbuf;
-
- tp.u_get (&fbuf);
- RtlCopyUnicodeString (&fbuf, pc.get_nt_native_path ());
- RtlAppendUnicodeToString (&fbuf, L"\\");
- RtlAppendUnicodeStringToString (&fbuf, fname);
- fbuf.Buffer += 4; /* Skip leading \??\ */
- fbuf.Length -= 4 * sizeof (WCHAR);
- if (fbuf.Buffer[1] != L':') /* UNC path */
- {
- *(fbuf.Buffer += 2) = L'\\';
- fbuf.Length -= 2 * sizeof (WCHAR);
- }
- path_conv fpath (&fbuf, PC_SYM_NOFOLLOW);
+ char *file = tp.c_get ();
+ char *p = stpcpy (file, pc.normalized_path);
+ *p++ = '/';
+ sys_wcstombs (p, NT_MAX_PATH - (p - file),
+ fname->Buffer, fname->Length / sizeof (WCHAR));
+ path_conv fpath (file, PC_SYM_NOFOLLOW);
if (fpath.issymlink ())
{
fname->Length -= 4 * sizeof (WCHAR);