Win32: Unicode file name support (dirent)
commit3770c3e3934dec43223bd2db3d00b1e67208f69e
authorKarsten Blees <blees@dcon.de>
Sat, 14 Jan 2012 21:01:09 +0000 (14 22:01 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 29 May 2012 02:18:52 +0000 (28 21:18 -0500)
treec5dced189e45a2214c0f0982b9758b0b3d1da066
parent2ee5a1a14ad17ff35f0ad52390a27fbbc41258f3
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