From: Anton Berezin Date: Thu, 29 Oct 1998 17:06:25 +0000 (+0100) Subject: win32_opendir() fails on empty drives X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=21e725129f7284f543ce260557cc7d475bd76241;p=p5sagit%2Fp5-mst-13.2.git win32_opendir() fails on empty drives Message-ID: <86pvbbuzcu.fsf@lion.plab.ku.dk> p4raw-id: //depot/perl@2148 --- diff --git a/win32/win32.c b/win32/win32.c index 53c9713..9e41d74 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; }