Repository navigation
Port upstream #133: a title run by its file name alone gets its own folder as G: - #39
Merged
DesertGamer merged 1 commit intoNov 25, 2026
Conversation
`victory run GTA6.exe`, run from the game folder, gives an exe path with
an empty parent, and that empty folder was mounted as G:. An empty path
cannot be made absolute, so the root stayed empty and G:\x64\a.rpf
became \x64\a.rpf: the root of the current drive. The title then found
none of its files.
An empty root is now the current directory, which is what an empty
folder means everywhere else (`Path::new("").join("x")` is `x` in the
current directory). Passing a path with a folder in it is unaffected.
(cherry picked from commit 01ae55a)
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.
What this changes
This ports Marvisak/VIctory#133 by Duff. It is cherry-picked with
-x, so the commit keeps their authorship.viport run <title>.exe, run from the game's own folder, gives an exe path with an empty parent.apps/viport/src/run.rstakesexe.parent(), which isSome(""), as the title's folder. When nogame_diris configured, that folder is mounted asG:(content_dirfalls back totitle_dir). Incrates/viport-hle/src/modules/files.rs,root_widecallsstd::path::absolute(root), which fails for an empty path, and the error is swallowed. The root stays empty, soG:\x64\a.rpfbecomes\x64\a.rpf: the root of the current drive. The title then finds none of its files. Passing a path that includes a folder works.The fix treats an empty root as
., which is what an empty folder means everywhere else. #133's test comes with it.VIPort has the upstream merge of #133 in its history, but the change is not in the tree. It was lost in a later merge.
Checked
docs/asset-policy.mdbuild.rs, git hook,.cargoconfig, CI change or script (or an issue explains why)cargo test --workspacepasses (not run, see below)cargo clippy --workspace --all-targets --locked -- -D warningspasses (forviport-hle, with CI: clear the clippy errors that keep main red since a3e7f17 #21 merged in locally)rustfmt; I did not reformat lines I did not changeWhat I ran
The standard-library behaviour the bug rests on, checked on Linux. The same functions behave the same on Windows:
cargo clippy -p viport-hle --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, with #21 merged in: clean.Not run:
cargo test -p viport-hle(Windows only), or the game. The new test,an_empty_root_is_the_current_directory, will run in the Windows CI test step.Overlaps
None. No open PR touches
viport-hle/src/modules/files.rs.🤖 Generated with Claude Code