mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +00:00
Strongly link tr and sed into system() and popen()
This commit is contained in:
parent
cafdb456ed
commit
1312f60245
9 changed files with 51 additions and 22 deletions
|
@ -35,6 +35,8 @@ LIBC_SYSTEM_A_DIRECTDEPS = \
|
|||
LIBC_STR \
|
||||
LIBC_SYSV \
|
||||
THIRD_PARTY_MUSL \
|
||||
THIRD_PARTY_SED \
|
||||
THIRD_PARTY_TR \
|
||||
|
||||
LIBC_SYSTEM_A_DEPS := \
|
||||
$(call uniq,$(foreach x,$(LIBC_SYSTEM_A_DIRECTDEPS),$($(x))))
|
||||
|
|
|
@ -743,15 +743,12 @@ static int TryBuiltin(bool wantexec) {
|
|||
return Usleep();
|
||||
if (!strcmp(args[0], "toupper"))
|
||||
return Toupper();
|
||||
if (_weaken(_tr) && !strcmp(args[0], "tr")) {
|
||||
return Fake(_weaken(_tr), wantexec);
|
||||
}
|
||||
if (_weaken(_sed) && !strcmp(args[0], "sed")) {
|
||||
return Fake(_weaken(_sed), wantexec);
|
||||
}
|
||||
if (_weaken(_awk) && !strcmp(args[0], "awk")) {
|
||||
if (!strcmp(args[0], "tr"))
|
||||
return Fake(_tr, wantexec);
|
||||
if (!strcmp(args[0], "sed"))
|
||||
return Fake(_sed, wantexec);
|
||||
if (_weaken(_awk) && strcmp(args[0], "awk"))
|
||||
return Fake(_weaken(_awk), wantexec);
|
||||
}
|
||||
if (_weaken(_curl) && !strcmp(args[0], "curl")) {
|
||||
return Fake(_weaken(_curl), wantexec);
|
||||
}
|
||||
|
|
|
@ -38,9 +38,7 @@
|
|||
* provides Bourne-like syntax on all platforms, including Windows. Many
|
||||
* builtin commands are included, e.g. exit, cd, rm, [, cat, wait, exec,
|
||||
* env, echo, read, true, test, kill, touch, rmdir, mkdir, false, mktemp
|
||||
* and usleep. It's also possible to __static_yoink() the symbols `_tr`,
|
||||
* `_sed`, `_awk`, and `_curl` for the tr, sed, awk and curl commands if
|
||||
* you're using the Cosmopolitan mono-repo.
|
||||
* sed, tr, and usleep.
|
||||
*
|
||||
* If you just have a program name and arguments, and you don't need the
|
||||
* full power of a UNIX-like shell, then consider using the Cosmopolitan
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue