From: Amine Khaldi Date: Sat, 17 May 2014 10:28:57 +0000 (+0000) Subject: [CRT] X-Git-Tag: backups/0.3.17@66124~1238 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=9273fa01fa21ea86155a08b938c286fc89b9da13 [CRT] * Update _fseeki64(). * Fixes some msvcrt tests. CORE-8080 svn path=/trunk/; revision=63320 --- diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index b4ccb1d7388..64138a5ca17 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -1170,19 +1170,10 @@ int CDECL _fseeki64(FILE* file, __int64 offset, int whence) flush_buffer(file); if(whence == SEEK_CUR && file->_flag & _IOREAD ) { - offset -= file->_cnt; - if (get_ioinfo(file->_file)->wxflag & WX_TEXT) { - /* Black magic correction for CR removal */ - int i; - for (i=0; i_cnt; i++) { - if (file->_ptr[i] == '\n') - offset--; - } - /* Black magic when reading CR at buffer boundary*/ - if(get_ioinfo(file->_file)->wxflag & WX_READCR) - offset--; - } + whence = SEEK_SET; + offset += _ftelli64(file); } + /* Discard buffered input */ file->_cnt = 0; file->_ptr = file->_base;