summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 53c97138f6..9e41d74bdb 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -657,6 +657,10 @@ win32_opendir(char *filename)
/* do the FindFirstFile call */
fh = FindFirstFile(scanname, &FindData);
if (fh == INVALID_HANDLE_VALUE) {
+ /* FindFirstFile() fails on empty drives! */
+ if (GetLastError() == ERROR_FILE_NOT_FOUND)
+ return p;
+ Safefree( p);
return NULL;
}