mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
don't create the path in QFS_Open if not writing
This commit is contained in:
parent
cb7bbff49f
commit
1fb50d2f08
1 changed files with 7 additions and 1 deletions
|
@ -1324,10 +1324,16 @@ QFS_Open (const char *path, const char *mode)
|
|||
{
|
||||
dstring_t *full_path = dstring_new ();
|
||||
QFile *file;
|
||||
const char *m;
|
||||
int write = 0;
|
||||
|
||||
dsprintf (full_path, "%s/%s", qfs_userpath, path);
|
||||
Sys_DPrintf ("QFS_Open: %s %s\n", full_path->str, mode);
|
||||
QFS_CreatePath (full_path->str);
|
||||
for (m = mode; *m; m++)
|
||||
if (*m == 'w' || *m == '+' || *m == 'a')
|
||||
write = 1;
|
||||
if (write)
|
||||
QFS_CreatePath (full_path->str);
|
||||
file = Qopen (full_path->str, mode);
|
||||
dstring_delete (full_path);
|
||||
return file;
|
||||
|
|
Loading…
Reference in a new issue