summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorAnton Berezin <tobez@tobez.org>1998-10-29 18:06:25 +0100
committerGurusamy Sarathy <gsar@cpan.org>1998-10-30 19:36:07 +0000
commit21e725129f7284f543ce260557cc7d475bd76241 (patch)
treecbed11e09af16c1c89268988605eae952c759831 /win32
parent2293b0e962ceeb5ca803801ee7e7f632513f6ebb (diff)
downloadperl-21e725129f7284f543ce260557cc7d475bd76241.tar.gz
win32_opendir() fails on empty drives
Message-ID: <86pvbbuzcu.fsf@lion.plab.ku.dk> p4raw-id: //depot/perl@2148
Diffstat (limited to 'win32')
-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;
}