27 Feb
2026
27 Feb
'26
4:58 p.m.
On Fri Feb 27 16:54:12 2026 +0000, Paul Gofman wrote:
This changes the logic, in the absence of alloc_buffer call it relies on file->bufsiz ignoring flags. That’s probably fine but given the interest of some apps in fiddling with file structs directly I personally don’t see such a difference as no-op. Maybe I will just split ternary expression with ‘if’ (I also think too complicated ternary expressions are less readable) but keep flag checks? Like this:
int written = 0, bufsize = 1;
if (size == 0)
return 0;
if ((file->_flag & (MSVCRT__NOBUF | _IOMYBUF | MSVCRT__USERBUF)) || msvcrt_alloc_buffer(file))
bufsize = file->_bufsiz;
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10199#note_130745