diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-04-14 09:15:35 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-04-14 09:15:35 +0000 |
commit | 949caed8f79371828855f891481cb550d63c3511 (patch) | |
tree | c057a74f81ea98d8e92389b87dd6880d54c739ab /winsup/cygwin | |
parent | fa22ec2bab8f87e42d1f1b91879680fa5f75b802 (diff) | |
download | cygnal-949caed8f79371828855f891481cb550d63c3511.tar.gz cygnal-949caed8f79371828855f891481cb550d63c3511.tar.bz2 cygnal-949caed8f79371828855f891481cb550d63c3511.zip |
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Fix
thinko in UNC path handling.
* path.cc (symlink_worker): Fix typo in comment. Fix UNC path handling.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2ce01ea67..718612324 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2008-04-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Fix + thinko in UNC path handling. + * path.cc (symlink_worker): Fix typo in comment. Fix UNC path handling. + 2008-04-13 Corinna Vinschen <corinna@vinschen.de> * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Simplify diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 0f400bbe8..4f81bf764 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -1619,7 +1619,7 @@ fhandler_disk_file::readdir_helper (DIR *dir, dirent *de, DWORD w32_err, RtlAppendUnicodeStringToString (&fbuf, fname); fbuf.Buffer += 4; /* Skip leading \??\ */ fbuf.Length -= 4 * sizeof (WCHAR); - if (*fbuf.Buffer == L'U') /* UNC path */ + if (fbuf.Buffer[1] != L':') /* UNC path */ { *(fbuf.Buffer += 2) = L'\\'; fbuf.Length -= 2 * sizeof (WCHAR); diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index c44a932cb..7c3bc04a5 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1642,11 +1642,11 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym, /* Amazing but true: Even though the ParseDisplayName method takes a wide char path name, it does not understand the Win32 prefix for long pathnames! So we have to tack off - the prefix and convert tyhe path to the "normal" syntax + the prefix and convert the path to the "normal" syntax for ParseDisplayName. I have no idea if it's able to take long path names at all since I can't test it right now. */ WCHAR *wc = wc_path + 4; - if (!wcscmp (wc, L"UNC\\")) + if (!wcsncmp (wc, L"UNC\\", 4)) *(wc += 2) = L'\\'; HRESULT res; if (SUCCEEDED (res = psl->ParseDisplayName (NULL, NULL, wc, NULL, |