# HG changeset patch # User Darkvater # Date 1172592349 0 # Node ID 9ac91c745e60b8334ae0503045f7c6e221242796 # Parent aafa27437708f6cbfb5a9290a03aa450387b368c (svn r8919) -Regression (UTF8) (try #2): Win9x is very picky about trailing slashes in paths, so C:\\* will not work (but C:\Windows\\* does; go figure). Thanks glx for pointing it out and for the initial fix. diff --git a/src/win32.cpp b/src/win32.cpp --- a/src/win32.cpp +++ b/src/win32.cpp @@ -665,8 +665,11 @@ d = dir_calloc(); if (d != NULL) { wchar_t search_path[MAX_PATH]; - /* build search path for FindFirstFile */ - _snwprintf(search_path, lengthof(search_path), L"%s\\*", path); + bool slash = path[wcslen(path) - 1] == L'\\'; + + /* build search path for FindFirstFile, try not to append additional slashes + * as it throws Win9x off its groove for root directories */ + _snwprintf(search_path, lengthof(search_path), L"%s%s*", path, slash ? L"" : L"\\"); *lastof(search_path) = '\0'; d->hFind = FindFirstFileW(search_path, &d->fd);