Piotr Caban : msvcp110: Always return empty string in _Read_dir on end of enumeration or error.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Dec 22 14:06:51 CST 2015
Module: wine
Branch: master
Commit: 77ec614ac4630eed384d24895503372817007720
URL: http://source.winehq.org/git/wine.git/?a=commit;h=77ec614ac4630eed384d24895503372817007720
Author: Piotr Caban <piotr at codeweavers.com>
Date: Tue Dec 22 11:11:03 2015 +0100
msvcp110: Always return empty string in _Read_dir on end of enumeration or error.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msvcp90/ios.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index 7440aff..6a75476 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -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)
More information about the wine-cvs
mailing list