5717 - Gamecode can open file "" for reading

This commit is contained in:
Zack Middleton 2013-02-15 21:08:47 -06:00
parent 92573270de
commit 2e45edb550
5 changed files with 38 additions and 9 deletions

View file

@ -192,6 +192,21 @@ const char *Sys_Dirname( char *path )
return dirname( path );
}
/*
==============
Sys_FOpen
==============
*/
FILE *Sys_FOpen( const char *ospath, const char *mode ) {
struct stat buf;
// check if path exists and is a directory
if ( !stat( ospath, &buf ) && S_ISDIR( buf.st_mode ) )
return NULL;
return fopen( ospath, mode );
}
/*
==================
Sys_Mkdir