hle(files): avoid double-prefixing host paths on the mounted drive letter #4468
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4468
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4467"
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?
@minervamagicka on GitHub · 2026-11-30 20:42 UTC · original
minervamagicka:fix/files-same-drive-double-prefix→main· +54 −0 · 1 files · 1 commits · openWhat it changes
When the title's host directory resides on a Windows
G:volume (for exampleG:\SteamLibrary\common\Title) and is mounted as the console's virtualG:drive viamount_at('G', root), host or CRT callers that pass an already-rewritten host path back throughfiles::translatehaverootprepended a second time (G:\SteamLibrary\common\Title\SteamLibrary\common\Title\...), causing file opens to fail on hostG:setups.translatenow checks whetherrestis already rooted at the mounted drive's hostroot(matching case-insensitively and across/and\, with a path-separator boundary check so sibling directories such asTitleExtraare still rewritten as title paths) and returnsNonewhen it is.Adds unit test
host_paths_on_the_same_drive_letter_are_not_prefixed_twicecovering ordinary title paths, sibling prefix-sharing directories, exact root, subpath, forward-slash/lowercase, and\\?\verbatim forms.How it was tested
G:drivetranslateon a hostG:drive were rewritten twice intoG:\<root>\<root>\...and failed to openG:drive without double-prefixingcargo testpassed for the crates it touches: yes (cargo test -p victory-hle --locked files::tests— 16/16 passed;cargo xtask policy --stagedok; 0 clippy warnings infiles.rs)Checked for overlap
files.rsfor overlapped reads andSearchPath, no overlap withtranslatesame-drive prefixing)@tikD1337 on GitHub · 2026-11-30 20:51 UTC · original
Tested headlessly on
origin/main(e1251c31, Windows 11, no game run):origin/main.cargo test -p victory-hle -- modules::files: 17 passed, 0 failed (466 filtered), no new warnings.(AI-assisted build/unit-test check; game runtime not launched.)
8d541b3245to9460c9ce3eView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.