Commit 77ec614a authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

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

parent a3c818b3
......@@ -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);
if(!FindNextFileA(handle, &data)) {
*type = status_unknown;
*target = '\0';
return target;
}
while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, "..")) {
do {
if(!FindNextFileA(handle, &data)) {
*type = status_unknown;
return NULL;
*target = '\0';
return target;
}
}
} while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, ".."));
strcpy(target, data.cFileName);
if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment