From: Gurusamy Sarathy Date: Tue, 10 Feb 1998 13:28:53 +0000 (-0500) Subject: [win32] fix opendir() problem on share names X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c6c1a8fdade112d307195fa6eff91d3af5c3ee70;p=p5sagit%2Fp5-mst-13.2.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 */