diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-03-02 15:11:53 -0800 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2012-03-02 15:11:53 -0800 |
commit | 474cea824fde58a7a2b81b9edc2ffe68d4843177 (patch) | |
tree | 9a575181a8c40640b1d405f76ed0e7e08fd6cd93 /toolbox | |
parent | 5ae3f93f3bafbeb1fc9a3324475c58c725749c5e (diff) | |
download | system_core-474cea824fde58a7a2b81b9edc2ffe68d4843177.zip system_core-474cea824fde58a7a2b81b9edc2ffe68d4843177.tar.gz system_core-474cea824fde58a7a2b81b9edc2ffe68d4843177.tar.bz2 |
Change "chown" to coreutils syntax.
Change-Id: I7d997b3254354908317feee54b6df9b2419718a6
Diffstat (limited to 'toolbox')
-rw-r--r-- | toolbox/chown.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/toolbox/chown.c b/toolbox/chown.c index e9d108b..576c904 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'; } |