diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2f2ff920c..6722d781f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2006-02-28 Corinna Vinschen + + * dir.cc (readdir_worker): Use slash as path separator when evaluating + namehash for paths below /proc. + * fhandler_netdrive.cc (fhandler_netdrive::readdir): Use expensive + inode number evaluation on share names. + 2006-02-27 Christopher Faylor * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index f1149bcf6..b81b83855 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -131,8 +131,12 @@ readdir_worker (DIR *dir, dirent *de) if (!is_dot && !is_dot_dot) { const char *w32name = ((fhandler_base *) dir->__fh)->get_win32_name (); + DWORD devn = ((fhandler_base *) dir->__fh)->get_device (); + /* Paths below /proc don't have a Win32 pendant. */ + if (devn == FH_PROC || devn == FH_PROCESS || devn == FH_REGISTRY) + de->d_ino = hash_path_name (de->d_ino, "/"); /* A drive's root dir has a trailing backslash already. */ - if (w32name[1] != ':' || w32name[2] != '\\' || w32name[3]) + else if (w32name[1] != ':' || w32name[2] != '\\' || w32name[3]) de->d_ino = hash_path_name (de->d_ino, "\\"); de->d_ino = hash_path_name (de->d_ino, de->d_name); } diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_netdrive.cc index 33833a63e..1cabce8b1 100644 --- a/winsup/cygwin/fhandler_netdrive.cc +++ b/winsup/cygwin/fhandler_netdrive.cc @@ -206,7 +206,10 @@ fhandler_netdrive::readdir (DIR *dir, dirent *de) dir->__d_position++; char *bs = strrchr (nro->lpRemoteName, '\\'); strcpy (de->d_name, bs ? bs + 1 : nro->lpRemoteName); - de->d_ino = hash_path_name (get_namehash (), de->d_name); + if (strlen (get_name ()) == 2) + de->d_ino = hash_path_name (get_namehash (), de->d_name); + else + de->d_ino = readdir_get_ino (dir, nro->lpRemoteName, false); res = 0; }