From: Gurusamy Sarathy Date: Tue, 10 Feb 1998 13:28:53 +0000 (-0500) Subject: [win32] fix opendir() problem on share names X-Git-Tag: accepted/trunk/20130322.191538~37744^2~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6c1a8fdade112d307195fa6eff91d3af5c3ee70;p=platform%2Fupstream%2Fperl.git [win32] fix opendir() problem on share names Message-Id: <199802101828.NAA10420@aatma.engin.umich.edu> Subject: Re: BUG: opendir and UNC names on NT p4raw-id: //depot/win32/perl@494 --- diff --git a/win32/win32.c b/win32/win32.c index 01c43b8..3eeaa6a 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -476,7 +476,10 @@ opendir(char *filename) /* check to see if filename is a directory */ if (win32_stat(filename, &sbuf) < 0 || (sbuf.st_mode & S_IFDIR) == 0) { - return NULL; + /* CRT is buggy on sharenames, so make sure it really isn't */ + DWORD r = GetFileAttributes(filename); + if (r == 0xffffffff || !(r & FILE_ATTRIBUTE_DIRECTORY)) + return NULL; } /* get the file system characteristics */