Bug in MSVCRT_fseek (with patch)

Erik de Castro Lopo mle+win at mega-nerd.com
Fri Apr 4 06:56:33 CDT 2008


Kirill K. Smirnov wrote:

> What if you try to fseek to the end of file (SEEK_END)? Should IOEOF flag be 
> cleared in this case?

I believe that for a standards conforming fseek it should be. See:

    http://www.opengroup.org/onlinepubs/000095399/functions/fseek.html

For standards conforming behaviour fseek(f,0,SEEK_END) clears the
flag, and the next fread will return 0 and set it again.

However, I realize that for wine, the standards are pretty much
moot as wine attempts to be bug compatible with windows. Obviously
some more testing (on windows and wine) is required.

> And may _lseek() function be better place for this?

I don't think so. _lseek keeps its own flags.

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"C++ is like jamming a helicopter inside a Miata and expecting
some sort of improvement." -- Drew Olbrich



More information about the wine-devel mailing list