diff options
| author | OreoFR <29048345+OreoFR@users.noreply.github.com> | 2026-11-30 14:19:21 +0100 |
|---|---|---|
| committer | OreoFR <29048345+OreoFR@users.noreply.github.com> | 2026-11-30 14:19:21 +0100 |
| commit | c06660c318cb009cb05f1a696a8d2e903d0e7cc9 (patch) | |
| tree | 0c3ad48bf46d88d48a778085afadd11ce5c309bd /runtime/src/pe_loader.cpp | |
| parent | e7c33662107196e6ba3dd143993dba4e5b44bf4c (diff) | |
| parent | f9f3ec4c68de13f0fe167f7619072613ba77d1c8 (diff) | |
Merge origin/main (f9f3ec4c6) into the carry of #1906
Current main after #2566; no new conflicts on top of the earlier carry merge.
Co-authored-by: Jordan <44410206+JordanWebDev@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/pe_loader.cpp')
| -rw-r--r-- | runtime/src/pe_loader.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp index 303469b06..49588b424 100644 --- a/runtime/src/pe_loader.cpp +++ b/runtime/src/pe_loader.cpp | |||
| @@ -188,6 +188,15 @@ std::filesystem::path tls_host_base_path() { | |||
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | std::filesystem::path tls_host_clone_dir() { | 190 | std::filesystem::path tls_host_clone_dir() { |
| 191 | if (const char* dir = std::getenv("LEONIDA_TEST_DIR"); dir && *dir) return std::filesystem::path(dir); | ||
| 192 | const char* tmp = std::getenv("TMP"); | ||
| 193 | const char* temp = std::getenv("TEMP"); | ||
| 194 | const char* profile = std::getenv("USERPROFILE"); | ||
| 195 | if ((!tmp || !*tmp) && (!temp || !*temp) && (!profile || !*profile)) { | ||
| 196 | std::error_code ec; | ||
| 197 | auto cwd = std::filesystem::current_path(ec); | ||
| 198 | if (!ec) return cwd; | ||
| 199 | } | ||
| 191 | wchar_t buf[MAX_PATH]; | 200 | wchar_t buf[MAX_PATH]; |
| 192 | DWORD n = GetTempPathW(MAX_PATH, buf); | 201 | DWORD n = GetTempPathW(MAX_PATH, buf); |
| 193 | if (n > 0 && n < MAX_PATH) return std::filesystem::path(buf); | 202 | if (n > 0 && n < MAX_PATH) return std::filesystem::path(buf); |