diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-03-08 17:28:40 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-03-08 17:28:40 +0000 |
commit | ca6fd6300ac6e4d4346c7a0ebd29931d5756b427 (patch) | |
tree | 2604336ba10496636054b244869cbb02d4c85aa9 /winsup/cygwin/fhandler_disk_file.cc | |
parent | 23c6ed039467501a15afe650efcc6a6354e7687d (diff) | |
download | cygnal-ca6fd6300ac6e4d4346c7a0ebd29931d5756b427.tar.gz cygnal-ca6fd6300ac6e4d4346c7a0ebd29931d5756b427.tar.bz2 cygnal-ca6fd6300ac6e4d4346c7a0ebd29931d5756b427.zip |
* fhandler_disk_file.cc (DIR_BUF_SIZE): Define required space for file
name in terms of sizeof(WCHAR).
(fhandler_disk_file::readdir_helper): Convert *all* of fname.
* path.cc (fillout_mntent): Use tmp_pathbuf for path buffer.
(symlink_worker): Ditto.
(SCAN_JUSTCHECKTHIS): New state for suffix_scan to define
that only the actual name gets cheked and a suffix is never attached.
(suffix_scan::has): If filename + suffix would be > NAME_MAX, start
in SCAN_JUSTCHECKTHIS state.
(suffix_scan::next): Add case for SCAN_JUSTCHECKTHIS.
(symlink_info::check): Use tmp_pathbuf for path buffer. Goto
file_not_symlink in case of invalid file name.
(realpath): Use tmp_pathbuf for path buffer.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index fbd66e2ff..e364d9f49 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -1542,7 +1542,7 @@ fhandler_disk_file::rmdir () #define DIR_BUF_SIZE (DIR_NUM_ENTRIES \ * (sizeof (FILE_ID_BOTH_DIR_INFORMATION) \ - + 2 * (NAME_MAX + 1))) + + (NAME_MAX + 1) * sizeof (WCHAR))) struct __DIR_cache { @@ -1786,7 +1786,8 @@ fhandler_disk_file::readdir_helper (DIR *dir, dirent *de, DWORD w32_err, } char tmp[NAME_MAX + 1]; - sys_wcstombs (tmp, NAME_MAX, fname->Buffer, fname->Length / sizeof (WCHAR)); + sys_wcstombs (tmp, NAME_MAX + 1, fname->Buffer, + fname->Length / sizeof (WCHAR)); if (pc.isencoded ()) fnunmunge (de->d_name, tmp); else |