install: shrink -D code. By Bernhard.
function old new delta install_main 726 707 -19
This commit is contained in:
parent
1c781cc8ff
commit
9f9c1935fa
@ -159,18 +159,15 @@ int install_main(int argc, char **argv)
|
|||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (opts & OPT_MKDIR_LEADING) {
|
||||||
|
char *ddir = xstrdup(dest);
|
||||||
|
bb_make_directory(dirname(ddir), 0755, FILEUTILS_RECUR);
|
||||||
|
/* errors are not checked. copy_file
|
||||||
|
* will fail if dir is not created. */
|
||||||
|
free(ddir);
|
||||||
|
}
|
||||||
if (isdir)
|
if (isdir)
|
||||||
dest = concat_path_file(last, basename(arg));
|
dest = concat_path_file(last, basename(arg));
|
||||||
if (opts & OPT_MKDIR_LEADING) {
|
|
||||||
char *slash = strrchr(dest, '/');
|
|
||||||
if (slash) {
|
|
||||||
*slash = '\0';
|
|
||||||
bb_make_directory(dest, 0755, FILEUTILS_RECUR);
|
|
||||||
/* errors are not checked. copy_file
|
|
||||||
* will fail if dir is not created. */
|
|
||||||
*slash = '/';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (copy_file(arg, dest, copy_flags)) {
|
if (copy_file(arg, dest, copy_flags)) {
|
||||||
/* copy is not made */
|
/* copy is not made */
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user