summaryrefslogtreecommitdiff
path: root/src/sys/sys_unix.c
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-02-15 21:08:47 -0600
committerTim Angus <tim@ngus.net>2013-02-16 21:58:25 +0000
commit870d3661390e50de8d5d9444477c10c8d7929a77 (patch)
treeb5d9c96ae3a82fa7ee7aeafa7aeda48c3d525842 /src/sys/sys_unix.c
parent04c8f48d8363b80540a3ce057908413b4479c92b (diff)
5717 - Gamecode can open file "" for reading
Diffstat (limited to 'src/sys/sys_unix.c')
-rw-r--r--src/sys/sys_unix.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sys/sys_unix.c b/src/sys/sys_unix.c
index b05cf855..7660edd1 100644
--- a/src/sys/sys_unix.c
+++ b/src/sys/sys_unix.c
@@ -186,6 +186,21 @@ const char *Sys_Dirname( char *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
==================