aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-04-16 10:02:01 +0100
committerRon Yorston <rmy@pobox.com>2023-04-16 10:02:01 +0100
commite3e510b52695bbf5c55d83c971dc23813325cfc9 (patch)
tree92c35013a9691b07b5ed386bacaab90c5fb8daae
parent9581d23964c7efad6f8e74e754e36c1ad292cf45 (diff)
downloadbusybox-w32-e3e510b52695bbf5c55d83c971dc23813325cfc9.tar.gz
busybox-w32-e3e510b52695bbf5c55d83c971dc23813325cfc9.tar.bz2
busybox-w32-e3e510b52695bbf5c55d83c971dc23813325cfc9.zip
win32: further fix incorrect path search in spawnvp
Commit 9581d2396 (win32: fix incorrect path search in spawnvp) fixed the unwanted PATH search for relative or absolute paths but broke the desired PATH search for Unix-style paths. (GitHub issue #310)
-rw-r--r--win32/process.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/process.c b/win32/process.c
index 65c65b0d0..62be6e0cc 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -368,7 +368,9 @@ mingw_spawnvp(int mode, const char *cmd, char *const *argv)
368 } 368 }
369 if (unix_path(cmd)) 369 if (unix_path(cmd))
370 cmd = bb_basename(cmd); 370 cmd = bb_basename(cmd);
371 } else if ((path = find_first_executable(cmd)) != NULL) { 371 }
372
373 if (!has_path(cmd) && (path = find_first_executable(cmd)) != NULL) {
372 ret = mingw_spawn_interpreter(mode, path, argv, NULL, 0); 374 ret = mingw_spawn_interpreter(mode, path, argv, NULL, 0);
373 free(path); 375 free(path);
374 return ret; 376 return ret;