chown: -2 bytes
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 22 Jan 2010 23:13:32 +0000 (00:13 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 22 Jan 2010 23:13:32 +0000 (00:13 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/chown.c

index d29f8252a5336e735cd34260123d2c6a69c3dbde..c6c1260ad6a0ccc107b02acce64ce92307ff82cf 100644 (file)
@@ -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;
 }