diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-12-04 10:42:07 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-12-04 10:42:07 +0100 |
commit | 4bd0c2ab38a53d5ecc89eacc61b3291d4fe01d51 (patch) | |
tree | bcba1c6bbae7988c0fe2b8f5375e8b5050a254c4 /coreutils | |
parent | fdb4421e00cc5115cffb55aac79c709a3a5108dd (diff) | |
download | busybox-w32-4bd0c2ab38a53d5ecc89eacc61b3291d4fe01d51.tar.gz busybox-w32-4bd0c2ab38a53d5ecc89eacc61b3291d4fe01d51.tar.bz2 busybox-w32-4bd0c2ab38a53d5ecc89eacc61b3291d4fe01d51.zip |
fix musl problem with dirname, now for all users of bb_make_directory()
function old new delta
bb_make_directory 412 419 +7
install_main 793 769 -24
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 7/-24) Total: -17 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/install.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/coreutils/install.c b/coreutils/install.c index d0dcd0e89..831f9b802 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
@@ -209,16 +209,10 @@ int install_main(int argc, char **argv) | |||
209 | dest = last; | 209 | dest = last; |
210 | if (opts & OPT_MKDIR_LEADING) { | 210 | if (opts & OPT_MKDIR_LEADING) { |
211 | char *ddir = xstrdup(dest); | 211 | char *ddir = xstrdup(dest); |
212 | char *dn = dirname(ddir); | 212 | bb_make_directory(dirname(ddir), 0755, mkdir_flags); |
213 | /* musl can return read-only "/" or "." string. | 213 | /* errors are not checked. copy_file |
214 | * bb_make_directory needs writable string. | 214 | * will fail if dir is not created. |
215 | */ | 215 | */ |
216 | if ((dn[0] != '/' && dn[0] != '.') || dn[1] != '\0') { | ||
217 | bb_make_directory(dn, 0755, mkdir_flags); | ||
218 | /* errors are not checked. copy_file | ||
219 | * will fail if dir is not created. | ||
220 | */ | ||
221 | } | ||
222 | free(ddir); | 216 | free(ddir); |
223 | } | 217 | } |
224 | if (isdir) | 218 | if (isdir) |