fix(libc): accept the ' flag in Windows formatting #3567
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3567"
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 DariusHQ on 2026-10-11T13:26:54Z.
What
FreeBSD's
vfprintftakes'as a flag: group the integer part ofd,i,u,f,F,gandGwith the locale's thousands separator. The guest formatter (FormatWindows) did not know it and threwUnsupported format conversion, soprintf("%'d", n)from a title aborted on Windows.The guest's
setlocaleaccepts only"C","POSIX"and"", all the C locale, and itslocaleconv()reports an emptythousands_sepandgrouping. So'never changes the output. The formatter now skips it before it hands the conversion to the host'ssnprintf, which also keeps the host's own locale from adding separators. TechnicalDebt no longer lists the'flag among what the guest formatter throws for.The formatter is shared: Windows runs it for every format, Linux only for formats with a guest wide conversion (
%ls,%lc,%S,%C) and hands the rest to glibc, which already accepts'.Tested
Windows 11 (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, full build with
BUILD_TESTING=ONonmaina11c8f7f7with four branches merged together: this one and the%#.0o,'flag, positional-argument andsendfilebranches opened alongside it:ctest833/837 passed. The four failures fail the same way onmainhere:windows_exceptions(#3411);guest_kernel_sys:symlinkthrowsFunction not implementedon Windows, which #3510 addresses;guest_filesystem: restoring the directory time fails on Windows, which #3518 addresses;agc_driver_emulated_color_compare: the GPU here cannot sample the sRGB image it uses.guest_formattingnow formats'throughsnprintfandvsnprintf: withd,u,fandg; next to-,+and0; with a width, a precision and thel,llandzlengths; and in a format with%ls. It fails without the fix.Not run on Linux (no Linux host here); the change has no platform-specific part.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T21:10:02Z.
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)docs/dev/TechnicalDebt.mdL555-556Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:34:46Z.
Checked the diff against FreeBSD
vfprintf('flag, no effect in the C locale), build + ctest on the touched libs (74 tests green), and thatguest_formattingfails without the change; merging.