Skip to content
Snippets Groups Projects
Commit 5ad3121a authored by rswindell's avatar rswindell
Browse files

Fix bug in Win32 version of fexist() - if first found match was a directory,

then would return FALSE (even if there was a matching file that would be found
next).
parent 1bb3712c
No related branches found
No related tags found
No related merge requests found
......@@ -447,19 +447,23 @@ BOOL DLLCALL fexist(const char *filespec)
long handle;
struct _finddata_t f;
BOOL found;
if(!strchr(filespec,'*') && !strchr(filespec,'?'))
return(fnameexist(filespec));
if((handle=_findfirst((char*)filespec,&f))==-1)
return(FALSE);
found=TRUE;
while(f.attrib&_A_SUBDIR)
if(_findnext(handle,&f)!=0) {
found=FALSE;
break;
}
_findclose(handle);
if(f.attrib&_A_SUBDIR)
return(FALSE);
return(TRUE);
return(found);
#else /* Unix or OS/2 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment