aboutsummaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-07-20 10:03:51 +0100
committerRon Yorston <rmy@pobox.com>2024-07-20 10:31:49 +0100
commitd18c624d993b7846fb13053bb7dc7bf1a12770ce (patch)
tree8d6ca12835230eb552375c2541f65ff4bf7ffc46 /networking/wget.c
parent640ac19cd76573a307d39e06bc3d22a38194a76f (diff)
downloadbusybox-w32-d18c624d993b7846fb13053bb7dc7bf1a12770ce.tar.gz
busybox-w32-d18c624d993b7846fb13053bb7dc7bf1a12770ce.tar.bz2
busybox-w32-d18c624d993b7846fb13053bb7dc7bf1a12770ce.zip
win32: consolidate executable handling in popen.c
Commit f444dc586 (win32: only search PATH for compressor) made mingw_fork_compressor() perform a PATH lookup for the xz and lzma compression programs. This avoided relying on CreateProcess() to perform the search. Other callers of the pipe creation code should also avoid reliance on CreateProcess's executable search: - Move the applet test and PATH lookup into mingw_popen_internal(). The first argument to CreateProcess() will always be a path to an executable. - mingw_fork_compressor() uses the new "w+" mode to indicate that xz and lzma compressors should be found on PATH. - mingw_popen() no longer needs to check for an applet itself, as that's now handled in mingw_popen_internal(). - spawn_ssl_client() in 'wget' can rely on the popen code to look up the 'ssl_client' applet. - Remove unnecessary argument checks in mingw_popen_internal(). Adds 0-24 bytes.
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/networking/wget.c b/networking/wget.c
index f3c0c89f3..b01304897 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -839,12 +839,11 @@ static void spawn_ssl_client(const char *host, int network_fd, int flags)
839 839
840 fflush_all(); 840 fflush_all();
841 841
842 cmd = xasprintf("%s --busybox ssl_client -h %p -n %s%s", 842 cmd = xasprintf("ssl_client -h %p -n %s%s",
843 bb_busybox_exec_path,
844 (void *)_get_osfhandle(network_fd), servername, 843 (void *)_get_osfhandle(network_fd), servername,
845 flags & TLSLOOP_EXIT_ON_LOCAL_EOF ? " -e" : ""); 844 flags & TLSLOOP_EXIT_ON_LOCAL_EOF ? " -e" : "");
846 845
847 if ( (fd1=mingw_popen_fd(NULL, cmd, "b", -1, NULL)) == -1 ) { 846 if ((fd1=mingw_popen_fd("ssl_client", cmd, "b", -1, NULL)) == -1) {
848 bb_perror_msg_and_die("can't execute ssl_client"); 847 bb_perror_msg_and_die("can't execute ssl_client");
849 } 848 }
850 849