Commit c1792e1a authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fixed ftell behaviour when file is opened for writing in text mode.

parent 1fae72e7
......@@ -3798,6 +3798,14 @@ __int64 CDECL MSVCRT__ftelli64(MSVCRT_FILE* file)
if(file->_bufsiz) {
if(file->_flag & MSVCRT__IOWRT) {
pos += file->_ptr - file->_base;
if(msvcrt_get_ioinfo(file->_file)->wxflag & WX_TEXT) {
char *p;
for(p=file->_base; p<file->_ptr; p++)
if(*p == '\n')
pos++;
}
} else if(!file->_cnt) { /* nothing to do */
} else if(MSVCRT__lseeki64(file->_file, 0, SEEK_END)==pos) {
int i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment