1
0
Fork 0
forked from fte/fteqw

create paths as needed

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4339 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2013-05-07 19:37:00 +00:00
parent 5330c9b124
commit 9c163d60aa

View file

@ -974,11 +974,15 @@ vfsfile_t *FS_OpenVFS(const char *filename, const char *mode, enum fs_relative r
if (*com_homedir) if (*com_homedir)
{ {
snprintf(fullname, sizeof(fullname), "%s%s/%s", com_homedir, gamedirfile, filename); snprintf(fullname, sizeof(fullname), "%s%s/%s", com_homedir, gamedirfile, filename);
if (*mode == 'w')
COM_CreatePath(fullname);
vfs = VFSOS_Open(fullname, mode); vfs = VFSOS_Open(fullname, mode);
if (vfs) if (vfs)
return vfs; return vfs;
} }
snprintf(fullname, sizeof(fullname), "%s%s/%s", com_quakedir, gamedirfile, filename); snprintf(fullname, sizeof(fullname), "%s%s/%s", com_quakedir, gamedirfile, filename);
if (*mode == 'w')
COM_CreatePath(fullname);
return VFSOS_Open(fullname, mode); return VFSOS_Open(fullname, mode);
case FS_GAME: case FS_GAME:
if (*com_homedir) if (*com_homedir)