Fix FileExists on directories.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3663
This commit is contained in:
parent
bf3e6ab0ef
commit
c56d4404c0
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue