[io] fix TFileMerger kOnlyListed suffix key leak#22435
Conversation
An unlisted key whose name is a prefix or suffix of a listed key was incorrectly included in the merged output, because the name check was a plain substring search with no leading word boundary. Fixes root-project#22414
There was a problem hiding this comment.
Pull request overview
This PR fixes TFileMerger::kOnlyListed object selection so listed object names are matched as space-delimited tokens, preventing unlisted keys whose names are suffixes of listed keys from being merged.
Changes:
- Updates
TFileMerger::MergeOneto search for" key "within a space-prefixed object-name list. - Adds a regression test covering suffix/prefix-like names when using
kOnlyListed.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
io/io/src/TFileMerger.cxx |
Tightens kOnlyListed name matching to require a leading delimiter. |
io/io/test/TFileMergerTests.cxx |
Adds regression coverage ensuring only the explicitly listed key is merged. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 22 files 22 suites 3d 11h 12m 57s ⏱️ For more details on these failures, see this check. Results for commit 3379b33. ♻️ This comment has been updated with latest results. |
|
/backport to 6.40 |
|
Preparing to backport PR #22435 to branch 6.40 requested by guitargeek |
|
This PR has been backported to branch 6.40: #22445 |
When using
PartialMergewithkOnlyListedan unlisted key whose name is a prefix or suffix of a listed key was incorrectly included in the merged output, because the name check was a plain substring search with no leading word boundary.This Pull request:
Changes or fixes: #22414
Checklist: