diff options
author | Ron Yorston <rmy@pobox.com> | 2024-08-17 11:38:30 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-08-17 11:57:45 +0100 |
commit | b21899038683bd646446d3db9e84f64ea669d2ed (patch) | |
tree | 086a63f81d5b637efaf87792fc0bf1da77e9662e /arch | |
parent | 027fb22e28fecc588d9e088a8d7d77fb63c7dc7b (diff) | |
download | busybox-w32-b21899038683bd646446d3db9e84f64ea669d2ed.tar.gz busybox-w32-b21899038683bd646446d3db9e84f64ea669d2ed.tar.bz2 busybox-w32-b21899038683bd646446d3db9e84f64ea669d2ed.zip |
which,ash: code shrink detection of standalone shell
Commit 6d87be4d7 (which,ash: changes to which/command/type) let
'which' detect when it's run from a standalone shell by having
the shell pass the undocumented '-s' option.
A better solution is to alter argv[0] when 'which' is run from a
standalone shell. This is possible because the code path through
run_noexec_applet_and_exit() and which_main() doesn't actually
use argv[0].
- No special treatment is required in ash when 'which' has no
arguments or the '--help' option.
- tryexec() no longer needs an extra element before the start of
argv. The commit 027fb22e2 can be reverted and the allocation
of argv in evalcommand() simplified.
- 'which' no longer needs to handle the '-s' option.
Saves 96-104 bytes.
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions