mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Make fatcosmocc good enough to build Lua 5.4.6
make all test CC=fatcosmocc AR='fatcosmoar rcu' This change introduces a program named mktemper.com which provides more reliable and secure temporary file name generation for scripts. It also makes our ar.com program more permissive in what commands it'll accept. The cosmocc command is improved by this change too.
This commit is contained in:
parent
566cb5963f
commit
399d14aadf
17 changed files with 612 additions and 629 deletions
|
@ -578,20 +578,25 @@ static int Env(void) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int Exec(void) {
|
||||
static wontreturn void Exec(void) {
|
||||
Shift(1);
|
||||
return ShellExec();
|
||||
if (!ShellExec()) {
|
||||
_Exit(0); // can happen for builtins
|
||||
} else {
|
||||
perror("exec");
|
||||
_Exit(127); // sh exec never returns
|
||||
}
|
||||
}
|
||||
|
||||
static int TryBuiltin(void) {
|
||||
if (!n) return exitstatus;
|
||||
if (!strcmp(args[0], "exit")) Exit();
|
||||
if (!strcmp(args[0], "exec")) Exec();
|
||||
if (!strcmp(args[0], "cd")) return Cd();
|
||||
if (!strcmp(args[0], "rm")) return Rm();
|
||||
if (!strcmp(args[0], "[")) return Test();
|
||||
if (!strcmp(args[0], "cat")) return Cat();
|
||||
if (!strcmp(args[0], "env")) return Env();
|
||||
if (!strcmp(args[0], "exec")) return Exec();
|
||||
if (!strcmp(args[0], "wait")) return Wait();
|
||||
if (!strcmp(args[0], "echo")) return Echo();
|
||||
if (!strcmp(args[0], "read")) return Read();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue