mirror of
https://github.com/ioquake/ioq3.git
synced 2025-06-02 18:01:34 +00:00
5717 - Gamecode can open file "" for reading
This commit is contained in:
parent
92573270de
commit
2e45edb550
5 changed files with 38 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue