From 9beb7f3b2bc721c97b0a95af1addb922d1fc4f38 Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 14 Jul 2011 13:05:36 +0000 Subject: [PATCH] Hopefully fixes log files. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3873 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/fs_win32.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/common/fs_win32.c b/engine/common/fs_win32.c index 99e8b005..9de9665b 100644 --- a/engine/common/fs_win32.c +++ b/engine/common/fs_win32.c @@ -131,6 +131,10 @@ vfsfile_t *VFSW32_Open(const char *osname, const char *mode) fsize = 0; mh = INVALID_HANDLE_VALUE; 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 { @@ -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) { - char diskname[MAX_OSPATH]; - //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(diskname, mode); + return VFSW32_Open(loc->rawname, mode); } 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->offset = 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;