mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 17:14:32 +00:00
[CRT]
* Update _fseeki64(). * Fixes some msvcrt tests. CORE-8080 svn path=/trunk/; revision=63320
This commit is contained in:
parent
ef2221fd12
commit
9273fa01fa
1 changed files with 3 additions and 12 deletions
|
@ -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<file->_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;
|
||||
|
|
Loading…
Reference in a new issue