mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
Remove COSMOPOLITAN_PROGRAM_EXECUTABLE (#1047)
This commit is contained in:
parent
68dbe5312f
commit
9801f2d1db
2 changed files with 0 additions and 23 deletions
|
@ -225,8 +225,6 @@ static inline void InitProgramExecutableNameImpl(void) {
|
|||
|
||||
// try argv[0], then argv[0].com, then $_, then $_.com.
|
||||
if (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;
|
||||
}
|
||||
|
|
|
@ -103,27 +103,6 @@ TEST(GetProramExecutableName, weirdArgv0NullEnv) {
|
|||
EXITS(0);
|
||||
}
|
||||
|
||||
TEST(GetProgramExecutableName, weirdArgv0CosmoVar) {
|
||||
if (skiptests) return;
|
||||
char buf[32 + PATH_MAX];
|
||||
stpcpy(stpcpy(buf, "COSMOPOLITAN_PROGRAM_EXECUTABLE="), self);
|
||||
SPAWN(fork);
|
||||
execve(self, (char *[]){"hello", "Child", self, "hello", 0},
|
||||
(char *[]){buf, 0});
|
||||
abort();
|
||||
EXITS(0);
|
||||
}
|
||||
|
||||
TEST(GetProgramExecutableName, weirdArgv0WrongCosmoVar) {
|
||||
if (skiptests) return;
|
||||
char *bad = "COSMOPOLITAN_PROGRAM_EXECUTABLE=hi";
|
||||
SPAWN(fork);
|
||||
execve(self, (char *[]){"hello", "Child", self, "hello", 0},
|
||||
(char *[]){bad, 0});
|
||||
abort();
|
||||
EXITS(0);
|
||||
}
|
||||
|
||||
TEST(GetProgramExecutableName, movedSelf) {
|
||||
if (skiptests) return;
|
||||
char buf[BUFSIZ];
|
||||
|
|
Loading…
Reference in a new issue