file_system: GetTempPath and GetTempFileName resolve GAME:, G: and T: to the overlay scratch folder #287

Open
github-bot wants to merge 5 commits from github-bot/gh-287 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:59 UTC · original
ubiquitarianism:old-pr/10017 → main · +246 −0 · 2 files · 5 commits · draft

Carried over from old PR 10017 by tedin7 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10017, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
tedin7: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

@ItsNotRexed: an exe PR, as you asked.

Rebased cleanly on current main; supersedes #8813 closed during org migration.

What

GetTempPathA/W and GetTempFileNameA/W in runtime/shims/file_system.cpp now resolve console temp locations (GAME:, G:, T:) to the overlay scratch folder instead of the package. Subdirectories and Unicode are kept, lossy (unrepresentable) paths and refused names fail with the right error, a missing directory is not created, and GetTempPathA returns the exact required size. Host paths pass through unchanged.

Why

Without this, a title asking for its temp path on a console root got a path inside the read-only package, or a mangled one.

Tested

file_system_test (clang-cl cross build, run under Wine): +124 lines of checks.

  • With the fix: every new check passes (513 checks, 7 failures).
  • Negative control (shim reverted to origin/main, same test file): 26 failures, 19 of them the new temp-path checks.
  • The 7 remaining failures (MAXIMUM_ALLOWED CreateFile x6, *.? listing x1) are identical on main and are Wine-only, unrelated to this change.
**@⁠Andretuta** on GitHub · 2026-11-24 02:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/287) `ubiquitarianism:old-pr/10017` → `main` · +246 −0 · 2 files · 5 commits · draft > Carried over from **old PR 10017** by `tedin7` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10017`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `tedin7`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): `@ItsNotRexed`: an exe PR, as you asked. Rebased cleanly on current main; supersedes `#8813` closed during org migration. ## What GetTempPathA/W and GetTempFileNameA/W in `runtime/shims/file_system.cpp` now resolve console temp locations (GAME:, G:, T:) to the overlay scratch folder instead of the package. Subdirectories and Unicode are kept, lossy (unrepresentable) paths and refused names fail with the right error, a missing directory is not created, and GetTempPathA returns the exact required size. Host paths pass through unchanged. ## Why Without this, a title asking for its temp path on a console root got a path inside the read-only package, or a mangled one. ## Tested `file_system_test` (clang-cl cross build, run under Wine): +124 lines of checks. - With the fix: every new check passes (513 checks, 7 failures). - Negative control (shim reverted to origin/main, same test file): 26 failures, 19 of them the new temp-path checks. - The 7 remaining failures (MAXIMUM_ALLOWED CreateFile x6, `*.?` listing x1) are identical on main and are Wine-only, unrelated to this change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:52:01 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/287/head:github-bot/gh-287'
git switch 'github-bot/gh-287'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-287'
git switch 'github-bot/gh-287'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-287'
git switch 'github-bot/gh-287'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-287'
git switch 'main'
git merge --squash 'github-bot/gh-287'
git switch 'main'
git merge --ff-only 'github-bot/gh-287'
git switch 'main'
git merge 'github-bot/gh-287'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.