diff --git a/libc/calls/getprogramexecutablename.greg.c b/libc/calls/getprogramexecutablename.greg.c index 1442f5f6c..70cd32a3e 100644 --- a/libc/calls/getprogramexecutablename.greg.c +++ b/libc/calls/getprogramexecutablename.greg.c @@ -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; }