aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2022-05-01 10:20:16 +0100
committerRon Yorston <rmy@pobox.com>2022-05-01 11:03:10 +0100
commit6d87be4d760ceda18d354c6d4c523a9adf50c04b (patch)
treeca286c74b3d0689591ce7bee6a9b98af93e15e21 /include
parentae61e126ee8e8200e87f285d9c410eb377505578 (diff)
downloadbusybox-w32-6d87be4d760ceda18d354c6d4c523a9adf50c04b.tar.gz
busybox-w32-6d87be4d760ceda18d354c6d4c523a9adf50c04b.tar.bz2
busybox-w32-6d87be4d760ceda18d354c6d4c523a9adf50c04b.zip
which,ash: changes to which/command/type
Change how 'which' detects if it was run from a standalone shell: the shell passes the undocumented '-s' option. This is stricter and more reliable than the previous method of checking the name of the binary. Add a function to determine the binary associated with a given applet name. This makes it possible for 'which' and 'command -v' to list the correct binary even for applets other than 'busybox'. For example, when the binary is called 'sh.exe' 'which sh' will report its path. In standalone shell mode 'command -V' and 'type' now report "xxx is a builtin applet" rather than "xxx is xxx", which is true but not very illuminating. (GitHub issue #248)
Diffstat (limited to 'include')
-rw-r--r--include/mingw.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h
index 8a9610898..5e01b874e 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -584,3 +584,4 @@ int unix_path(const char *path);
584int has_path(const char *file); 584int has_path(const char *file);
585int is_relative_path(const char *path); 585int is_relative_path(const char *path);
586char *get_last_slash(const char *path); 586char *get_last_slash(const char *path);
587const char *applet_to_exe(const char *name);