1
0
Fork 0

Fix FileExists on directories.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3663
This commit is contained in:
Peter Veenstra 2010-12-04 14:33:39 +00:00
parent bf3e6ab0ef
commit c56d4404c0

View file

@ -394,9 +394,9 @@ bool localDrive::FileExists(const char* name) {
strcat(newname,name);
CROSS_FILENAME(newname);
dirCache.ExpandName(newname);
FILE* Temp=fopen(newname,"rb");
if(Temp==NULL) return false;
fclose(Temp);
struct stat temp_stat;
if(stat(newname,&temp_stat)!=0) return false;
if(temp_stat.st_mode & S_IFDIR) return false;
return true;
}