1
0
Fork 0
forked from fte/fteqw

fix for log files.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3889 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2011-07-28 01:42:10 +00:00
parent 0f31d3d7e8
commit 4dba0e3f28

View file

@ -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
{