Remove COSMOPOLITAN_PROGRAM_EXECUTABLE (#1047)

This commit is contained in:
Jōshin 2024-01-01 10:25:16 -05:00 committed by GitHub
parent 68dbe5312f
commit 9801f2d1db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 23 deletions

View file

@ -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;
}

View file

@ -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];