aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-09-06 14:35:08 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-09-06 14:35:08 +0000
commit9f9c1935fa6df1431e54792d67b928bf157a6d36 (patch)
tree04a108c2b426ec0778f64788e4879b165db528a1 /coreutils
parent1c781cc8fffa64ae59438bf653994cf908ba2b35 (diff)
downloadbusybox-w32-9f9c1935fa6df1431e54792d67b928bf157a6d36.tar.gz
busybox-w32-9f9c1935fa6df1431e54792d67b928bf157a6d36.tar.bz2
busybox-w32-9f9c1935fa6df1431e54792d67b928bf157a6d36.zip
install: shrink -D code. By Bernhard.
function old new delta install_main 726 707 -19
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/install.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/coreutils/install.c b/coreutils/install.c
index 69bf7dc55..2b796e2a1 100644
--- a/coreutils/install.c
+++ b/coreutils/install.c
@@ -159,18 +159,15 @@ int install_main(int argc, char **argv)
159 goto next; 159 goto next;
160 } 160 }
161 } else { 161 } else {
162 if (isdir)
163 dest = concat_path_file(last, basename(arg));
164 if (opts & OPT_MKDIR_LEADING) { 162 if (opts & OPT_MKDIR_LEADING) {
165 char *slash = strrchr(dest, '/'); 163 char *ddir = xstrdup(dest);
166 if (slash) { 164 bb_make_directory(dirname(ddir), 0755, FILEUTILS_RECUR);
167 *slash = '\0'; 165 /* errors are not checked. copy_file
168 bb_make_directory(dest, 0755, FILEUTILS_RECUR); 166 * will fail if dir is not created. */
169 /* errors are not checked. copy_file 167 free(ddir);
170 * will fail if dir is not created. */
171 *slash = '/';
172 }
173 } 168 }
169 if (isdir)
170 dest = concat_path_file(last, basename(arg));
174 if (copy_file(arg, dest, copy_flags)) { 171 if (copy_file(arg, dest, copy_flags)) {
175 /* copy is not made */ 172 /* copy is not made */
176 ret = EXIT_FAILURE; 173 ret = EXIT_FAILURE;