5717 - Gamecode can open file "" for reading
This commit is contained in:
1 parent
92573270de
commit
2e45edb550
5 files changed
+38
-9
No files matched your search
@@ -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
|
||||
|
||||
@@ -283,6 +283,15 @@ const char *Sys_Dirname( char *path )
|
||||
return dir;
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
Sys_FOpen
|
||||
==============
|
||||
*/
|
||||
FILE *Sys_FOpen( const char *ospath, const char *mode ) {
|
||||
return fopen( ospath, mode );
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
Sys_Mkdir
|
||||
|
||||
Reference in new issue
Block a user