fix(libc): keep EOF sticky across appended stream data #5682
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5682"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T06:18:34Z.
Fixes #5279.
What
A Windows host stream can resume reading after EOF when another handle appends bytes, while FreeBSD keeps returning EOF until
clearerr, a seek, orungetc. Keep the guest stream’s EOF behavior consistent acrossfgetc,fgets,fread, andfscanf, including the EOF return rules for formats that do or do not require input. The regression covers the reported append-after-EOF sequence and scanner format cases.The change carries Hussein Kadhim’s reviewed fix commits with his original commit authorship preserved. The known
%n-leading format limitation remains recorded inTechnicalDebt.md.Tested
guest_standard_streamsandfile_streamspassed (2/2).tools/check_conventions.py --base upstream/mainpassed.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T06:23:26Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libc/src/StandardStreams.cppL42Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T06:32:59Z.
Closing this duplicate: it carries the same EOF-sticky implementation already reviewed in #5330 (and #5222). The maintainer closed #5330 because no title-specific failure was identified and asked contributors to hold generic PRs while the queue is high. I should have found that history before opening this PR.
Pull request closed