mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Make improvements
- Expand redbean UNIX module - Expand redbean documentation - Ensure Lua copyright is embedded in binary - Increase the PATH_MAX limit especially on NT - Use column major sorting for linenoise completions - Fix some suboptimalities in redbean's new UNIX API - Figured out right flags for Multics newline in raw mode
This commit is contained in:
parent
cf3174dc74
commit
2046c0d2ae
305 changed files with 6602 additions and 4221 deletions
|
@ -29,6 +29,13 @@ void SetUp(void) {
|
|||
} else {
|
||||
exit(7);
|
||||
}
|
||||
} else if (getenv("_WEIRDENV")) {
|
||||
for (char **e = environ; *e; ++e) {
|
||||
if (!strcmp(*e, "WEIRD")) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
exit(7);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,3 +54,20 @@ TEST(execve, testWeirdAnsiC89emptyArgv) {
|
|||
EXPECT_TRUE(WIFEXITED(ws));
|
||||
EXPECT_EQ(0, WEXITSTATUS(ws));
|
||||
}
|
||||
|
||||
TEST(execve, testWeirdEnvironmentVariable) {
|
||||
char *prog;
|
||||
int pid, ws;
|
||||
if (IsWindows()) return;
|
||||
if (IsOpenbsd()) return;
|
||||
prog = GetProgramExecutableName();
|
||||
ASSERT_NE(-1, (pid = fork()));
|
||||
if (!pid) {
|
||||
execve(prog, (char *const[]){prog, 0},
|
||||
(char *const[]){"_WEIRDENV=1", "WEIRD", 0});
|
||||
_Exit(127);
|
||||
}
|
||||
ASSERT_NE(-1, wait(&ws));
|
||||
EXPECT_TRUE(WIFEXITED(ws));
|
||||
EXPECT_EQ(0, WEXITSTATUS(ws));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue