msvcp110: Always return empty string in _Read_dir on end of enumeration or error.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2015-12-22 11:11:03 +01:00 committed by Alexandre Julliard
parent a3c818b33d
commit 77ec614ac4
1 changed files with 6 additions and 8 deletions

View File

@ -14483,18 +14483,16 @@ void* __cdecl tr2_sys__Open_dir(char* target, char const* dest, int* err_code, e
char* __cdecl tr2_sys__Read_dir(char* target, void* handle, enum file_type* type)
{
WIN32_FIND_DATAA data;
TRACE("(%p %p %p)\n", target, handle, type);
do {
if(!FindNextFileA(handle, &data)) {
*type = status_unknown;
*target = '\0';
return target;
}
while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, "..")) {
if(!FindNextFileA(handle, &data)) {
*type = status_unknown;
return NULL;
}
}
} while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, ".."));
strcpy(target, data.cFileName);
if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)