fix: stop cleanName truncating titles that contain a dot - #26
Merged
Conversation
Adopted from upstream LoveRetro#722 by Eric Reinsmidt, taken while upstream is still GPL-3.0 (see LoveRetro#765). cleanName() ran removeExtension() over names the game time db already stores without one, so the first dot in a title was read as a suffix boundary. "Gun.Smoke" displayed as "Gun" and "Dr.Mario" as "Dr". Both callers in this tree - gametime.c and gametimedb.c - pass rom->name, which is stored extension-free, so dropping the removeExtension() call is safe for every caller we have. Covered in tests/test_utils.c: the two truncation cases fail without the fix, alongside guards for the behaviour that has to survive it - numeric sorting prefixes, underscores and region parens. Co-Authored-By: Eric Reinsmidt <eric@reinsmidt.com>
lepht
force-pushed
the
claude/adopt-upstream-722-cleanname
branch
from
August 12, 2026 04:14
c2c4d44 to
39c3ccd
Compare
lepht
pushed a commit
that referenced
this pull request
Aug 12, 2026
Brings in the three upstream adoptions (#26, #27, #28) now on main. One conflict, in the scroll-text block of nextui.c. Both sides edited adjacent lines for unrelated reasons: - this branch added SCREEN_CONTEXTMENU to the outer screen exclusion list - #27 added a total>0 guard to the inner condition Resolved as the union of both, which is the only correct answer here. Taking ours alone drops total>0 and reopens #6 two lines above the top->entries->items[top->selected] read; taking theirs alone drops the context menu exclusion and renders scroll text over it. Git auto-merged the other five guard sites #27 added. Verified after the merge: no assert(entry) remains, every read of entries->items[top->selected] sits behind a count or total>0 check, nextui.c is syntax-clean against the desktop platform headers, and make test passes.
lepht
pushed a commit
that referenced
this pull request
Aug 12, 2026
Carries the main merge (and with it #26, #27, #28) up the stack. Same single conflict as one level down, in the same two lines of nextui.c: this branch had added SCREEN_SEARCH to the outer screen exclusion list on top of SCREEN_CONTEXTMENU, while #27 added a total>0 guard to the inner condition. Resolved as the union again - all four screen exclusions kept, total>0 kept. Verified after the merge: no assert(entry) remains, every read of entries->items[top->selected] is guarded, nextui.c is syntax-clean against the desktop platform headers, and make test passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopted from upstream LoveRetro/NextUI#722 by @ericreinsmidt.
The bug
cleanName()ranremoveExtension()over names the game time db already stores without one, so the first dot in a title was read as a suffix boundary:Gun.SmokeGunDr.MarioDrremoveExtension()has a guard (*(lastExt+1) != ' ') that spares001. Sonic, which is why this only ever bit titles with a dot followed by a non-space.The fix
Drop the
removeExtension()call and itsfree(). Both callers in this tree —gametime.c:250andgametimedb.c:462— passrom->name, which is stored extension-free, so no caller relied on the stripping. I also checkedfeat/favoritesandfeat/rom-search: neither adds acleanNamecaller, so the in-flight stack is unaffected.Testing
tests/test_utils.calready linksutils.c, so this is covered directly. The tests were written before the fix and confirmed to fail on exactly the two truncation cases:The four other checks — numeric sorting prefixes, underscores, region parens, multi-dot titles like
R.C. Pro-Am— passed before and after, so the change is bounded to the reported defect.make testis green.Why now
Upstream is mid-transition from GPL-3.0 to PolyForm Noncommercial (LoveRetro/NextUI#765). Their
LICENSEis still GPL-3.0 today, so this is adoptable now; code taken after the transition would not be. Original authorship is preserved in the commit trailer.