Win32: Unicode file name support (dirent)
commit8a771b414c4e5ffd20db1a1a0b2f003a9a7d23c1
authorKarsten Blees <blees@dcon.de>
Sat, 14 Jan 2012 21:01:09 +0000 (14 22:01 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Mon, 1 Oct 2012 13:34:48 +0000 (1 14:34 +0100)
tree39f52a8d7cf295caea6aa54785da65865f7c0c9a
parent60defb4ac9c814c82852c367c9e0bde0264cac44
Win32: Unicode file name support (dirent)

Changes opendir/readdir to use Windows Unicode APIs and convert between
UTF-8/UTF-16.

Removes parameter checks that are already covered by xutftowcs_path. This
changes detection of ENAMETOOLONG from MAX_PATH - 2 to MAX_PATH (matching
is_dir_empty in mingw.c). If name + "/*" or the resulting absolute path is
too long, FindFirstFile fails and errno is set through err_win_to_posix.

Increases the size of dirent.d_name to accommodate the full
WIN32_FIND_DATA.cFileName converted to UTF-8 (UTF-16 to UTF-8 conversion
may grow by factor three in the worst case).

Signed-off-by: Karsten Blees <blees@dcon.de>
compat/win32/dirent.c
compat/win32/dirent.h