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:
Justine Tunney 2022-04-24 09:59:22 -07:00
parent cf3174dc74
commit 2046c0d2ae
305 changed files with 6602 additions and 4221 deletions

View file

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