diff options
author | Ron Yorston <rmy@pobox.com> | 2020-08-13 11:36:29 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-08-13 14:58:01 +0100 |
commit | 258ad6a1d52f1811f9de1d6b976f3797f5b31a2b (patch) | |
tree | e195bfa9eccb187e3e83ef797f516a92b539787e /win32/process.c | |
parent | 5a48290d9bdb827657114c24aa75c67bb1bd0ea7 (diff) | |
download | busybox-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 'win32/process.c')
-rw-r--r-- | win32/process.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/process.c b/win32/process.c index ac63a9c58..1118eb18a 100644 --- a/win32/process.c +++ b/win32/process.c | |||
@@ -348,7 +348,7 @@ mingw_spawn_1(int mode, const char *cmd, char *const *argv, char *const *envp) | |||
348 | return mingw_spawn_applet(mode, argv, envp); | 348 | return mingw_spawn_applet(mode, argv, envp); |
349 | else | 349 | else |
350 | #endif | 350 | #endif |
351 | if (strchr(cmd, '/') || strchr(cmd, '\\') || has_dos_drive_prefix(cmd)) { | 351 | if (has_path(cmd)) { |
352 | const char *path = auto_win32_extension(cmd); | 352 | const char *path = auto_win32_extension(cmd); |
353 | return mingw_spawn_interpreter(mode, path ? path : cmd, argv, envp, 0); | 353 | return mingw_spawn_interpreter(mode, path ? path : cmd, argv, envp, 0); |
354 | } | 354 | } |