feat(libc): implement wcstok #3583
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3583"
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:45:45Z.
What
wcstok(8ngzWNZzFJU) in libc, on the guest's 16-bitwchar_t, next towcsspnand with the sameContainshelper.PS5MC (PPSA99420 1.2, VivaLaVent/PS5MC) stops at it at start-up once
sendfileis exported (#3568). Run on Windows, catalog build witheboot.binandsce_module/libc.prxunwrapped as #2605 requires,maina11c8f7f7with #3568 merged in:With this branch added it goes on to
pause(EDyhWelj7UY), run the same way:#2220 implemented this before and was closed because no title had been run to it. This PR is that run.
It follows FreeBSD's three-argument
wcstok:textnull it continues from*last, and returns null when that is null;*lastbecomes null and it returns null;*lastpoints past it;*lastto null, not to the terminator asstrtok_rdoes.Code units are compared one at a time, so a surrogate pair is never split by a BMP delimiter.
Tested
Windows 11 (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, full build with
BUILD_TESTING=ONonmaina11c8f7f7with this branch and #3568 merged together: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_wide_stringschecks:*lastafter each token;*lastnull;*lastnull, the string left intact);Mutation check, all caught:
*lastleft at the terminator after the last token;*lastleft set when only delimiters remain;*lastpointing at the delimiter instead of past it;textnot continuing from*last.tools/import_audit.pyon PS5MC relinked with--windows --registry: absent imports go from 27 (with #3568) to 26.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)wcstok)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T13:46:07Z.
Progress report (
a11c8f7→6ef110a)📈 System libraries: 85.82% (+0.01%, +1 implemented functions)
✅ 1 implemented
wcstok_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:38:21Z.
Checked against FreeBSD's
wcstok.c(delimiter skipping,*lastnull on exhaustion, delimiter overwritten,*last = end + 1); build and ctest on Linux for libs/libc green, andguest_wide_stringsfails to link without the change. Merging.