diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-21 19:31:37 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-21 19:38:02 +0200 |
commit | 1de709fda2e75aeef160b3b13a43865e7a622f06 (patch) | |
tree | 94b6051597a1b2912fd596e5e762db90a9409a14 /coreutils | |
parent | 34d79c9aa0c2ba23f62e49134c337797b37d2878 (diff) |
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.c | 62 |
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) last = argv[argc - 1]; /* If there are only two arguments and... */ if (argc == 2) { - s_flags = cp_mv_stat2(*argv, &source_stat, - (flags & FILEUTILS_DEREFERENCE) ? stat : lstat); - if (s_flags < 0) - return EXIT_FAILURE; - d_flags = cp_mv_stat(last, &dest_stat); - if (d_flags < 0) - return EXIT_FAILURE; + s_flags = cp_mv_stat2(*argv, &source_stat, + (flags & FILEUTILS_DEREFERENCE) ? stat : lstat); + if (s_flags < 0) + return EXIT_FAILURE; + d_flags = cp_mv_stat(last, &dest_stat); + if (d_flags < 0) + return EXIT_FAILURE; - if (flags & FILEUTILS_NO_TARGET_DIR) { /* -T */ - if (!(s_flags & 2) && (d_flags & 2)) - /* cp -T NOTDIR DIR */ - bb_error_msg_and_die("'%s' is a directory", last); - } + if (flags & FILEUTILS_NO_TARGET_DIR) { /* -T */ + if (!(s_flags & 2) && (d_flags & 2)) + /* cp -T NOTDIR DIR */ + bb_error_msg_and_die("'%s' is a directory", last); + } #if ENABLE_FEATURE_CP_LONG_OPTIONS - //bb_error_msg("flags:%x FILEUTILS_RMDEST:%x OPT_parents:%x", - // flags, FILEUTILS_RMDEST, OPT_parents); - if (flags & OPT_parents) { - if (!(d_flags & 2)) { - bb_simple_error_msg_and_die("with --parents, the destination must be a directory"); + //bb_error_msg("flags:%x FILEUTILS_RMDEST:%x OPT_parents:%x", + // flags, FILEUTILS_RMDEST, OPT_parents); + if (flags & OPT_parents) { + if (!(d_flags & 2)) { + bb_simple_error_msg_and_die("with --parents, the destination must be a directory"); + } + } + if (flags & FILEUTILS_RMDEST) { + flags |= FILEUTILS_FORCE; } - } - if (flags & FILEUTILS_RMDEST) { - flags |= FILEUTILS_FORCE; - } #endif - /* ...if neither is a directory... */ - if (!((s_flags | d_flags) & 2) - /* ...or: recursing, the 1st is a directory, and the 2nd doesn't exist... */ - || ((flags & FILEUTILS_RECUR) && (s_flags & 2) && !d_flags) - || (flags & FILEUTILS_NO_TARGET_DIR) - ) { - /* Do a simple copy */ - dest = last; - goto DO_COPY; /* NB: argc==2 -> *++argv==last */ - } + /* ...if neither is a directory... */ + if (!((s_flags | d_flags) & 2) + /* ...or: recursing, the 1st is a directory, and the 2nd doesn't exist... */ + || ((flags & FILEUTILS_RECUR) && (s_flags & 2) && !d_flags) + || (flags & FILEUTILS_NO_TARGET_DIR) + ) { + /* Do a simple copy */ + dest = last; + goto DO_COPY; /* NB: argc==2 -> *++argv==last */ + } } else if (flags & FILEUTILS_NO_TARGET_DIR) { bb_simple_error_msg_and_die("too many arguments"); } |