projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
blah, forgot to save last time to fix whitespacing
[oweals/busybox.git]
/
coreutils
/
chgrp.c
diff --git
a/coreutils/chgrp.c
b/coreutils/chgrp.c
index ac3e81ad9d710ff2327174d73a420a3ac864a6aa..8cfb54241b2cb994a67df57bddca69f45407e5dc 100644
(file)
--- a/
coreutils/chgrp.c
+++ b/
coreutils/chgrp.c
@@
-2,8
+2,7
@@
/*
* Mini chgrp implementation for busybox
*
/*
* Mini chgrp implementation for busybox
*
- * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
- * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
* 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
*
* 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
@@
-30,7
+29,7
@@
#include <unistd.h>
#include "busybox.h"
#include <unistd.h>
#include "busybox.h"
-/* Don't use lchown
for libc5 or
glibc older then 2.1.x */
+/* Don't use lchown glibc older then 2.1.x */
#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
#define lchown chown
#endif
#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
#define lchown chown
#endif
@@
-49,7
+48,6
@@
int chgrp_main(int argc, char **argv)
long gid;
int recursiveFlag;
int retval = EXIT_SUCCESS;
long gid;
int recursiveFlag;
int retval = EXIT_SUCCESS;
- char *p;
recursiveFlag = bb_getopt_ulflags(argc, argv, "R");
recursiveFlag = bb_getopt_ulflags(argc, argv, "R");
@@
-60,15
+58,12
@@
int chgrp_main(int argc, char **argv)
argv += optind;
/* Find the selected group */
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 {
++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;
}
fileAction, fileAction, &gid)) {
retval = EXIT_FAILURE;
}