* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't

copy filename twice in the non-managed case.
This commit is contained in:
Corinna Vinschen 2008-03-12 15:04:06 +00:00
parent 2b2b42cf59
commit 31812fc0bc
2 changed files with 16 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2008-03-12 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't
copy filename twice in the non-managed case.
2008-03-12 Corinna Vinschen <corinna@vinschen.de>
* winsup.h (NT_MAX_PATH): Revert ill-advised change to 32767.

View File

@ -1785,16 +1785,20 @@ fhandler_disk_file::readdir_helper (DIR *dir, dirent *de, DWORD w32_err,
}
}
char tmp[NAME_MAX + 1];
sys_wcstombs (tmp, NAME_MAX + 1, fname->Buffer,
fname->Length / sizeof (WCHAR));
if (pc.isencoded ())
fnunmunge (de->d_name, tmp);
{
char tmp[NAME_MAX + 1];
sys_wcstombs (tmp, NAME_MAX + 1, fname->Buffer,
fname->Length / sizeof (WCHAR));
fnunmunge (de->d_name, tmp);
}
else
strcpy (de->d_name, tmp);
if (dir->__d_position == 0 && !strcmp (tmp, "."))
sys_wcstombs (de->d_name, NAME_MAX + 1, fname->Buffer,
fname->Length / sizeof (WCHAR));
if (dir->__d_position == 0 && !strcmp (de->d_name, "."))
dir->__flags |= dirent_saw_dot;
else if (dir->__d_position == 1 && !strcmp (tmp, ".."))
else if (dir->__d_position == 1 && !strcmp (de->d_name, ".."))
dir->__flags |= dirent_saw_dot_dot;
return 0;
}