aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-06-21 19:31:37 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-06-21 19:38:02 +0200
commit1de709fda2e75aeef160b3b13a43865e7a622f06 (patch)
tree94b6051597a1b2912fd596e5e762db90a9409a14 /coreutils
parent34d79c9aa0c2ba23f62e49134c337797b37d2878 (diff)
downloadbusybox-w32-1de709fda2e75aeef160b3b13a43865e7a622f06.tar.gz
busybox-w32-1de709fda2e75aeef160b3b13a43865e7a622f06.tar.bz2
busybox-w32-1de709fda2e75aeef160b3b13a43865e7a622f06.zip
cp: preparatory indenting of code block, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cp.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c
index f92ba6886..ac00e09bf 100644
--- a/coreutils/cp.c
+++ b/coreutils/cp.c
@@ -198,43 +198,43 @@ int cp_main(int argc, char **argv)
198 last = argv[argc - 1]; 198 last = argv[argc - 1];
199 /* If there are only two arguments and... */ 199 /* If there are only two arguments and... */
200 if (argc == 2) { 200 if (argc == 2) {
201 s_flags = cp_mv_stat2(*argv, &source_stat, 201 s_flags = cp_mv_stat2(*argv, &source_stat,
202 (flags & FILEUTILS_DEREFERENCE) ? stat : lstat); 202 (flags & FILEUTILS_DEREFERENCE) ? stat : lstat);
203 if (s_flags < 0) 203 if (s_flags < 0)
204 return EXIT_FAILURE; 204 return EXIT_FAILURE;
205 d_flags = cp_mv_stat(last, &dest_stat); 205 d_flags = cp_mv_stat(last, &dest_stat);
206 if (d_flags < 0) 206 if (d_flags < 0)
207 return EXIT_FAILURE; 207 return EXIT_FAILURE;
208 208
209 if (flags & FILEUTILS_NO_TARGET_DIR) { /* -T */ 209 if (flags & FILEUTILS_NO_TARGET_DIR) { /* -T */
210 if (!(s_flags & 2) && (d_flags & 2)) 210 if (!(s_flags & 2) && (d_flags & 2))
211 /* cp -T NOTDIR DIR */ 211 /* cp -T NOTDIR DIR */
212 bb_error_msg_and_die("'%s' is a directory", last); 212 bb_error_msg_and_die("'%s' is a directory", last);
213 } 213 }
214 214
215#if ENABLE_FEATURE_CP_LONG_OPTIONS 215#if ENABLE_FEATURE_CP_LONG_OPTIONS
216 //bb_error_msg("flags:%x FILEUTILS_RMDEST:%x OPT_parents:%x", 216 //bb_error_msg("flags:%x FILEUTILS_RMDEST:%x OPT_parents:%x",
217 // flags, FILEUTILS_RMDEST, OPT_parents); 217 // flags, FILEUTILS_RMDEST, OPT_parents);
218 if (flags & OPT_parents) { 218 if (flags & OPT_parents) {
219 if (!(d_flags & 2)) { 219 if (!(d_flags & 2)) {
220 bb_simple_error_msg_and_die("with --parents, the destination must be a directory"); 220 bb_simple_error_msg_and_die("with --parents, the destination must be a directory");
221 }
222 }
223 if (flags & FILEUTILS_RMDEST) {
224 flags |= FILEUTILS_FORCE;
221 } 225 }
222 }
223 if (flags & FILEUTILS_RMDEST) {
224 flags |= FILEUTILS_FORCE;
225 }
226#endif 226#endif
227 227
228 /* ...if neither is a directory... */ 228 /* ...if neither is a directory... */
229 if (!((s_flags | d_flags) & 2) 229 if (!((s_flags | d_flags) & 2)
230 /* ...or: recursing, the 1st is a directory, and the 2nd doesn't exist... */ 230 /* ...or: recursing, the 1st is a directory, and the 2nd doesn't exist... */
231 || ((flags & FILEUTILS_RECUR) && (s_flags & 2) && !d_flags) 231 || ((flags & FILEUTILS_RECUR) && (s_flags & 2) && !d_flags)
232 || (flags & FILEUTILS_NO_TARGET_DIR) 232 || (flags & FILEUTILS_NO_TARGET_DIR)
233 ) { 233 ) {
234 /* Do a simple copy */ 234 /* Do a simple copy */
235 dest = last; 235 dest = last;
236 goto DO_COPY; /* NB: argc==2 -> *++argv==last */ 236 goto DO_COPY; /* NB: argc==2 -> *++argv==last */
237 } 237 }
238 } else if (flags & FILEUTILS_NO_TARGET_DIR) { 238 } else if (flags & FILEUTILS_NO_TARGET_DIR) {
239 bb_simple_error_msg_and_die("too many arguments"); 239 bb_simple_error_msg_and_die("too many arguments");
240 } 240 }