summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2015-06-01 15:22:42 +0100
committerRon Yorston <rmy@pobox.com>2015-06-01 15:22:42 +0100
commit7bf5f10016ef3d99d4a6a45b6a300d04d930de2a (patch)
treec027805369d9ceaef80e47731353b914228d89ea /archival
parent0f08b401f107732d6c88486a739f26ce04578c34 (diff)
downloadbusybox-w32-7bf5f10016ef3d99d4a6a45b6a300d04d930de2a.tar.gz
busybox-w32-7bf5f10016ef3d99d4a6a45b6a300d04d930de2a.tar.bz2
busybox-w32-7bf5f10016ef3d99d4a6a45b6a300d04d930de2a.zip
mingw: add magic '--busybox' flag
If BusyBox is invoked with argv[1] set to --busybox skip the first two arguments so that argv[2] becomes the applet name and argv[3] et seq are its arguments. This is needed when BusyBox is run as sh.exe and the executable is reexecuted to invoke compress/decompress applets.
Diffstat (limited to 'archival')
-rw-r--r--archival/libarchive/open_transformer.c3
-rw-r--r--archival/tar.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c
index 24524f6ee..c7ec4a74d 100644
--- a/archival/libarchive/open_transformer.c
+++ b/archival/libarchive/open_transformer.c
@@ -163,7 +163,8 @@ void FAST_FUNC fork_transformer(int fd, const char *transform_prog)
163 int fd1; 163 int fd1;
164 164
165 if (find_applet_by_name(transform_prog) >= 0) { 165 if (find_applet_by_name(transform_prog) >= 0) {
166 cmd = xasprintf("%s %s -cf -", bb_busybox_exec_path, transform_prog); 166 cmd = xasprintf("%s --busybox %s -cf -", bb_busybox_exec_path,
167 transform_prog);
167 } 168 }
168 else { 169 else {
169 cmd = xasprintf("%s -cf -", transform_prog); 170 cmd = xasprintf("%s -cf -", transform_prog);
diff --git a/archival/tar.c b/archival/tar.c
index 1f9dd23d2..d1b0e475d 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -685,7 +685,7 @@ static pid_t vfork_compressor(int tar_fd, const char *gzip)
685 pid_t pid; 685 pid_t pid;
686 686
687 if (find_applet_by_name(gzip) >= 0) { 687 if (find_applet_by_name(gzip) >= 0) {
688 cmd = xasprintf("%s %s -cf -", bb_busybox_exec_path, gzip); 688 cmd = xasprintf("%s --busybox %s -cf -", bb_busybox_exec_path, gzip);
689 } 689 }
690 else { 690 else {
691 cmd = xasprintf("%s -cf -", gzip); 691 cmd = xasprintf("%s -cf -", gzip);