diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-06-22 18:59:10 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-06-22 18:59:10 +0200 |
commit | 34254f9ddece34d4df541438ec4f6a1b19929926 (patch) | |
tree | 93e353134c52d5c05c6d10277cea81e67aa6d50d | |
parent | 148788eb0ee96026105755cf3fd1ad3d94f49cd2 (diff) | |
download | busybox-w32-34254f9ddece34d4df541438ec4f6a1b19929926.tar.gz busybox-w32-34254f9ddece34d4df541438ec4f6a1b19929926.tar.bz2 busybox-w32-34254f9ddece34d4df541438ec4f6a1b19929926.zip |
install: fix "-D -t DIR1/DIR2/DIR3" creating only DIR1/DIR2, closes 11106
function old new delta
install_main 758 767 +9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/install.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/coreutils/install.c b/coreutils/install.c index 2e4dc257f..8270490bd 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
@@ -214,7 +214,11 @@ int install_main(int argc, char **argv) | |||
214 | dest = last; | 214 | dest = last; |
215 | if (opts & OPT_MKDIR_LEADING) { | 215 | if (opts & OPT_MKDIR_LEADING) { |
216 | char *ddir = xstrdup(dest); | 216 | char *ddir = xstrdup(dest); |
217 | bb_make_directory(dirname(ddir), 0755, mkdir_flags); | 217 | /* |
218 | * -D -t DIR1/DIR2/F3 FILE: create DIR1/DIR2/F3, copy FILE there | ||
219 | * -D FILE DIR1/DIR2/F3: create DIR1/DIR2, copy FILE there as F3 | ||
220 | */ | ||
221 | bb_make_directory((opts & OPT_TARGET) ? ddir : dirname(ddir), 0755, mkdir_flags); | ||
218 | /* errors are not checked. copy_file | 222 | /* errors are not checked. copy_file |
219 | * will fail if dir is not created. | 223 | * will fail if dir is not created. |
220 | */ | 224 | */ |