fix(savedata): let a trailing % in a directory name pattern match nothing #4504
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4504"
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 EagleBearerYS on 2026-10-12T13:46:58Z.
What
sceSaveDataDirNameSearchreads%in the directory name pattern as any run of characters and_as exactly one (the same rules shadPS4's matcher states in its comments: "0 or more wildcard", "1 character wildcard").dir_name_matchstopped as soon as the name ran out and then required the pattern to have ended too, so a%that was left at the end with nothing to match made the whole match fail:mainTRAIL,TRAIL1TRAIL%TRAIL1TRAIL,TRAIL1TRAIL,TRAIL1TRAIL%%TRAIL1TRAIL,TRAIL1TRAIL,TRAIL1TRAI_%TRAIL1TRAIL,TRAIL1TRAIL,TRAIL1TRAIL_%TRAIL1TRAIL1A title that names its main save
SAVEDATAand looks for its saves withSAVEDATA%gets no hit for that save and treats it as missing. The matcher now skips the%s left at the end of the pattern before it checks that both strings have ended, so a trailing%matches no characters as one in the middle already did. A%in the middle,_, and a pattern without wildcards behave as before. TechnicalDebt now names the source of the wildcard rules, which are not confirmed on hardware either.Tested
Windows 11 (10.0.26300), WinLibs MinGW-w64 GCC 15.2.0 r7 (UCRT), Release,
-DBUILD_TESTING=ON, onmainatc6efe068:TrailingWildcardsinguest_savedata_searchcreates the savesTRAILandTRAIL1and searches with the four patterns in the table. Withmain'sExport.cppit fails at the first pattern (a trailing % must also match no characters); with the change it passes, 20 runs in a row.core/libs/prx/libc/CMakeLists.txtandcore/libs/prx/libkernel/CMakeLists.txtthat build on Windows pass, and so do the other save-data tests (guest_savedata_cancel,guest_savedata_convert,guest_savedata_delete,guest_savedata_mount_status,savedata_core_write_replacement,savedata_memory_growth,savedata_memory_growth_read_failure,savedata_memory_metadata,savedata_native_write_replacement,savedata_replace_file_failure).tools/check_conventions.py --base origin/mainpasses.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)