From 4dba0e3f28fc068b14ef990ffb99777eb3290aee Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 28 Jul 2011 01:42:10 +0000 Subject: [PATCH] fix for log files. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3889 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/fs_win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/common/fs_win32.c b/engine/common/fs_win32.c index 9624bdae8..63b457fde 100644 --- a/engine/common/fs_win32.c +++ b/engine/common/fs_win32.c @@ -115,7 +115,7 @@ vfsfile_t *VFSW32_Open(const char *osname, const char *mode) if (strchr(mode, '+')) read = write = true; - if (write && read) + if ((write && read) || append) h = CreateFileA(osname, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_DELETE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); else if (write) h = CreateFileA(osname, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); @@ -134,7 +134,7 @@ vfsfile_t *VFSW32_Open(const char *osname, const char *mode) /*if appending, set the access position to the end of the file*/ if (append) - SetFilePointer(h, GetFileSize(h, NULL), NULL, FILE_BEGIN); + SetFilePointer(h, 0, NULL, FILE_END); } else {