diff -r 558c0c7b6fd4 -r f93251621d20 src/win32.cpp --- a/src/win32.cpp Tue Feb 27 16:05:20 2007 +0000 +++ b/src/win32.cpp Tue Feb 27 16:05:49 2007 +0000 @@ -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);