mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Make more fixes and improvements
This change attempts to fix some report build issues. It also builds upon development work described in previous changes.
This commit is contained in:
parent
9bfa6ec06e
commit
9d61e23c80
27 changed files with 980 additions and 902 deletions
|
@ -7,8 +7,30 @@
|
|||
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
|
||||
╚─────────────────────────────────────────────────────────────────*/
|
||||
#endif
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
||||
int main() {
|
||||
__printargs("");
|
||||
int pip[2];
|
||||
char buf[PATH_MAX];
|
||||
char *args[2] = {0};
|
||||
if (strcmp(nulltoempty(getenv("TERM")), "dumb") && isatty(0) && isatty(1) &&
|
||||
((args[0] = commandv("less", buf)) ||
|
||||
(args[0] = commandv("more", buf)))) {
|
||||
close(0);
|
||||
close(2);
|
||||
pipe(pip);
|
||||
if (!vfork()) {
|
||||
close(2);
|
||||
execv(args[0], args);
|
||||
_Exit(127);
|
||||
}
|
||||
close(0);
|
||||
__printargs("");
|
||||
close(2);
|
||||
wait(0);
|
||||
} else {
|
||||
__printargs("");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue