summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-03-02 16:10:50 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-02 16:10:50 -0800
commit0afee8b668d1ff5bae4294108d5e21abfae28d12 (patch)
treecbf47b697204d151790f80428be2b73e6cf30500 /toolbox
parent9c38e14299bd4cb3693fca2e353a4fa9d8a55c85 (diff)
parent474cea824fde58a7a2b81b9edc2ffe68d4843177 (diff)
downloadsystem_core-0afee8b668d1ff5bae4294108d5e21abfae28d12.zip
system_core-0afee8b668d1ff5bae4294108d5e21abfae28d12.tar.gz
system_core-0afee8b668d1ff5bae4294108d5e21abfae28d12.tar.bz2
Merge "Change "chown" to coreutils syntax."
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/chown.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toolbox/chown.c b/toolbox/chown.c
index 7b24c52..92efee6 100644
--- a/toolbox/chown.c
+++ b/toolbox/chown.c
@@ -15,7 +15,7 @@ int chown_main(int argc, char **argv)
int i;
if (argc < 3) {
- fprintf(stderr, "Usage: chown <USER>[.GROUP] <FILE1> [FILE2] ...\n");
+ fprintf(stderr, "Usage: chown <USER>[:GROUP] <FILE1> [FILE2] ...\n");
return 10;
}
@@ -24,7 +24,9 @@ int chown_main(int argc, char **argv)
char user[32];
char *group = NULL;
strncpy(user, argv[1], sizeof(user));
- if ((group = strchr(user, '.')) != NULL) {
+ if ((group = strchr(user, ':')) != NULL) {
+ *group++ = '\0';
+ } else if ((group = strchr(user, '.')) != NULL) {
*group++ = '\0';
}