Permalink
Browse files

Merge "Change "chown" to coreutils syntax."

  • Loading branch information...
jsharkey authored and Android (Google) Code Review committed Mar 3, 2012
2 parents 9c38e14 + 474cea8 commit 0afee8b668d1ff5bae4294108d5e21abfae28d12
Showing with 4 additions and 2 deletions.
  1. +4 −2 toolbox/chown.c
View
@@ -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';
}

0 comments on commit 0afee8b

Please sign in to comment.