From 1de709fda2e75aeef160b3b13a43865e7a622f06 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 21 Jun 2021 19:31:37 +0200 Subject: cp: preparatory indenting of code block, no code changes Signed-off-by: Denys Vlasenko --- coreutils/cp.c | 62 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'coreutils') diff --git a/coreutils/cp.c b/coreutils/cp.c index f92ba68..ac00e09 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"); } -- cgit v1.1