msvcrt [3/4] take 2: Fix fread

Duane Clark fpga at pacbell.net
Sun Jul 30 14:55:01 CDT 2006


The previous version was breaking from the while(rcnt>0) loop incorrectly.

On Windows, _read() does not necessarily return the requested number of
bytes in text mode, but fread does if the data is available. The
previous patch causes Wine to duplicate the Windows behavior of _read.
But Wine's fread expected _read to return the requested number of bytes,
if they were available.

So this patch fixes two things. One is that it needs to strip carriage
returns out of data from the buffer. And the second is that it might
need to call _read multiple times to completely file the requested buffer.

Changelog: Fix fread



-------------- next part --------------
A non-text attachment was scrubbed...
Name: file06.diff
Type: text/x-patch
Size: 2336 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060730/aa2e97fc/file06.bin


More information about the wine-patches mailing list