mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-06 18:00:28 +00:00
Support COSMOPOLITAN_PROGRAM_EXECUTABLE
The loader implementing it was never minted, so it seems reasonable not to keep support for it indefinitely. But it seems impolite to break the prerelease loaders people may have been using between releases.
This commit is contained in:
parent
e582b1c286
commit
259e6fd3c4
1 changed files with 3 additions and 1 deletions
|
@ -185,9 +185,11 @@ static inline void InitProgramExecutableNameImpl(void) {
|
|||
goto UseEmpty;
|
||||
}
|
||||
|
||||
// Try what the loader supplied first. Fall back to argv[0],
|
||||
// try what the loader supplied first. fall back to argv[0],
|
||||
// then argv[0].com, then $_, then $_.com.
|
||||
if (TryPath(__program_executable_name, 0) || TryPath(__argv[0], 1) ||
|
||||
/* TODO(mrdomino): remove after next loader mint */
|
||||
TryPath(__getenv(__envp, "COSMOPOLITAN_PROGRAM_EXECUTABLE").s, 0) ||
|
||||
TryPath(__getenv(__envp, "_").s, 1)) {
|
||||
goto UseBuf;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue