aboutsummaryrefslogtreecommitdiff
path: root/debianutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-08-13 11:36:29 +0100
committerRon Yorston <rmy@pobox.com>2020-08-13 14:58:01 +0100
commit258ad6a1d52f1811f9de1d6b976f3797f5b31a2b (patch)
treee195bfa9eccb187e3e83ef797f516a92b539787e /debianutils
parent5a48290d9bdb827657114c24aa75c67bb1bd0ea7 (diff)
downloadbusybox-w32-258ad6a1d52f1811f9de1d6b976f3797f5b31a2b.tar.gz
busybox-w32-258ad6a1d52f1811f9de1d6b976f3797f5b31a2b.tar.bz2
busybox-w32-258ad6a1d52f1811f9de1d6b976f3797f5b31a2b.zip
win32: code shrink
Add a new function, has_path(), to detect that an executable name doesn't require a path look-up. Also, since is_absolute_path() is now only used in shell/ash.c move its definition there from include/mingw.h. Saves 128 bytes.
Diffstat (limited to 'debianutils')
-rw-r--r--debianutils/which.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/debianutils/which.c b/debianutils/which.c
index 590d50683..1f8c1a538 100644
--- a/debianutils/which.c
+++ b/debianutils/which.c
@@ -70,8 +70,7 @@ int which_main(int argc UNUSED_PARAM, char **argv)
70#if !ENABLE_PLATFORM_MINGW32 70#if !ENABLE_PLATFORM_MINGW32
71 if (strchr(*argv, '/')) { 71 if (strchr(*argv, '/')) {
72#else 72#else
73 if (strchr(*argv, '/') || strchr(*argv, '\\') || 73 if (has_path(*argv)) {
74 has_dos_drive_prefix(*argv)) {
75 if ((p=auto_win32_extension(*argv)) != NULL) { 74 if ((p=auto_win32_extension(*argv)) != NULL) {
76 missing = 0; 75 missing = 0;
77 puts(bs_to_slash(p)); 76 puts(bs_to_slash(p));