Files: .. on a virtual drive stops at its root in short paths too (G:\..\x left the package folder) #258
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/258"
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 avatarmanz/VIctory-7900XTX. Originally posted by sharan104 on 2026-11-26T13:32:25Z.
A virtual drive's root is the root of a drive to the title, so
X:\..isX:\again.translate()already handles this for long paths: anything of 248 characters or more goes throughverbatim(), which stops..at the root. But a short path was joined to the host folder as it came, and the host's own clean-up then climbed above that folder. So:G:\..\xopenedxbeside the package folder instead ofG:\x...from the persistent-storage drive reached the data directory around the title's storage folder.This affects every title path call that goes through
translate():CreateFileW,fopen,GetFileAttributesWand the rest.Fix: a short path now drops each
..that would climb above the root (within_root) before the host sees it. Everything else is still left to the host's clean-up, as before.\\?\paths, which the host doesn't clean up, are unchanged.Only an exact
..component climbs. I checkedGetFullPathNameWon Windows 11:..,...,.. .and..are kept as literal names, or trimmed when they're the last part, and none of them goes up a level. So matching exactly..covers every spelling that climbs.Test:
dot_dot_stays_on_the_drivechecks the rewritten strings. It also checks realGetFileAttributesWcalls against a mounted temp folder:X:\..\outside.txtis not found, whileX:\..\inside.txtandX:/a/../../inside.txtare found. It fails before the change, where the host path keepsinner\..\a, and passes after it.Results:
cargo test -p victory-hle --locked: 156 passed, 0 failed, 2 ignored. The new test passed 10 out of 10 runs.cargo clippy -p victory-hle --all-targets --locked --no-deps -- -D warningsis clean, with and without--all-features.🤖 Generated with Claude Code
View 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.