X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fchgrp.c;h=8cfb54241b2cb994a67df57bddca69f45407e5dc;hb=0fb397e6176bebd31d27f8b2105b808091207366;hp=2f3fa4197a71dece7205e7848c8d3937f0f25e02;hpb=85e5e72bc1acd9d58c11bde6e14c8270cd9f169f;p=oweals%2Fbusybox.git diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c index 2f3fa4197..8cfb54241 100644 --- a/coreutils/chgrp.c +++ b/coreutils/chgrp.c @@ -2,7 +2,7 @@ /* * Mini chgrp implementation for busybox * - * Copyright (C) 1999-2003 by Erik Andersen + * Copyright (C) 1999-2004 by Erik Andersen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,7 +48,6 @@ int chgrp_main(int argc, char **argv) long gid; int recursiveFlag; int retval = EXIT_SUCCESS; - char *p; recursiveFlag = bb_getopt_ulflags(argc, argv, "R"); @@ -59,15 +58,12 @@ int chgrp_main(int argc, char **argv) argv += optind; /* Find the selected group */ - gid = strtoul(*argv, &p, 10); /* maybe it's already numeric */ - if (*p || (p == *argv)) { /* trailing chars or nonnumeric */ - gid = my_getgrnam(*argv); - } + gid = get_ug_id(*argv, my_getgrnam); ++argv; /* Ok, ready to do the deed now */ do { - if (! recursive_action (*argv, recursiveFlag, FALSE, FALSE, + if (! recursive_action (*argv, recursiveFlag, FALSE, FALSE, fileAction, fileAction, &gid)) { retval = EXIT_FAILURE; }