summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorLauri Kasanen2020-04-15 15:01:44 +0300
committerDenys Vlasenko2020-04-29 14:37:21 +0200
commitb9943741c26e1e597edc142066f428540d1f1207 (patch)
tree913ce91cfc641c54593f04596294ebe6f8f6d7d1 /archival
parent9aa751b08ab03d6396f86c3df77937a19687981b (diff)
downloadbusybox-b9943741c26e1e597edc142066f428540d1f1207.zip
busybox-b9943741c26e1e597edc142066f428540d1f1207.tar.gz
unzip: -d should create the dir
The official Info-Zip unzip creates the dir if it doesn't exist. Signed-off-by: Lauri Kasanen <cand@gmx.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival')
-rw-r--r--archival/unzip.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/archival/unzip.c b/archival/unzip.c
index 8c4cb98..d94bbab 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -646,8 +646,14 @@ int unzip_main(int argc, char **argv)
}
/* Change dir if necessary */
- if (base_dir)
+ if (base_dir) {
+ /* -p DIR: try to create, errors don't matter.
+ * UnZip 6.00 does no multi-level mkdir (-p DIR1/DIR2 syntax),
+ * not using bb_make_directory() here (yet?)
+ */
+ mkdir(base_dir, 0777);
xchdir(base_dir);
+ }
if (quiet <= 1) { /* not -qq */
if (quiet == 0) {