summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-22 23:13:32 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2010-01-22 23:13:32 (GMT)
commit9882b34fe22ad55d554fd4451387e472fcc69e8b (patch)
treea704f17a673ab8db5e8bd0112e5aefa2805c3cf2
parent31416d589ebb34eeab1af151dd50015105e3db98 (diff)
downloadbusybox-9882b34fe22ad55d554fd4451387e472fcc69e8b.tar.gz
busybox-9882b34fe22ad55d554fd4451387e472fcc69e8b.tar.bz2
chown: -2 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/chown.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/coreutils/chown.c b/coreutils/chown.c
index d29f825..c6c1260 100644
--- a/coreutils/chown.c
+++ b/coreutils/chown.c
@@ -89,7 +89,6 @@ int chown_main(int argc UNUSED_PARAM, char **argv)
param.ugid.uid = -1;
param.ugid.gid = -1;
- param.chown_func = chown;
#if ENABLE_FEATURE_CHOWN_LONG_OPTIONS
applet_long_options = chown_longopts;
@@ -99,6 +98,7 @@ int chown_main(int argc UNUSED_PARAM, char **argv)
argv += optind;
/* This matches coreutils behavior (almost - see below) */
+ param.chown_func = chown;
if (OPT_NODEREF
/* || (OPT_RECURSE && !OPT_TRAVERSE_TOP): */
IF_DESKTOP( || (opt & (BIT_RECURSE|BIT_TRAVERSE_TOP)) == BIT_RECURSE)
@@ -117,8 +117,7 @@ int chown_main(int argc UNUSED_PARAM, char **argv)
parse_chown_usergroup_or_die(&param.ugid, argv[0]);
/* Ok, ready to do the deed now */
- argv++;
- do {
+ while (*++argv) {
if (!recursive_action(*argv,
flags, /* flags */
fileAction, /* file action */
@@ -128,7 +127,7 @@ int chown_main(int argc UNUSED_PARAM, char **argv)
) {
retval = EXIT_FAILURE;
}
- } while (*++argv);
+ }
return retval;
}