1
0
Fork 0
forked from fte/fteqw

Hopefully fixes log files.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3873 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2011-07-14 13:05:36 +00:00
parent 4943723a8b
commit 9beb7f3b2b

View file

@ -131,6 +131,10 @@ vfsfile_t *VFSW32_Open(const char *osname, const char *mode)
fsize = 0; fsize = 0;
mh = INVALID_HANDLE_VALUE; mh = INVALID_HANDLE_VALUE;
mmap = NULL; mmap = NULL;
/*if appending, set the access position to the end of the file*/
if (append)
SetFilePointer(h, GetFileSize(h, NULL), NULL, FILE_BEGIN);
} }
else else
{ {
@ -168,13 +172,9 @@ vfsfile_t *VFSW32_Open(const char *osname, const char *mode)
static vfsfile_t *VFSW32_OpenVFS(void *handle, flocation_t *loc, const char *mode) static vfsfile_t *VFSW32_OpenVFS(void *handle, flocation_t *loc, const char *mode)
{ {
char diskname[MAX_OSPATH];
//path is already cleaned, as anything that gets a valid loc needs cleaning up first. //path is already cleaned, as anything that gets a valid loc needs cleaning up first.
snprintf(diskname, sizeof(diskname), "%s/%s", (char*)handle, loc->rawname); return VFSW32_Open(loc->rawname, mode);
return VFSW32_Open(diskname, mode);
} }
static void VFSW32_PrintPath(void *handle) static void VFSW32_PrintPath(void *handle)
@ -247,7 +247,7 @@ static qboolean VFSW32_FLocate(void *handle, flocation_t *loc, const char *filen
loc->len = len; loc->len = len;
loc->offset = 0; loc->offset = 0;
loc->index = 0; loc->index = 0;
Q_strncpyz(loc->rawname, filename, sizeof(loc->rawname)); snprintf(loc->rawname, sizeof(loc->rawname), "%s/%s", (char*)handle, filename);
} }
return true; return true;