summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-04-27 21:30:52 +0200
committerJim Meyering <meyering@redhat.com>2012-04-27 23:01:21 +0200
commitc83f723267dff03e954ba77454d51a691dfba1c0 (patch)
tree8c3fc2784fdf2c2b65645516ba69a60ed272dde9 /src
parentc8b8279d2bd9ed1005ebbcca018446d3a245b97c (diff)
downloadcoreutils-c83f723267dff03e954ba77454d51a691dfba1c0.tar.xz
id: -Zn/-Zr: avoid an invalid diagnostic
* src/id.c (main): Using -Z with -r or -n would fail with "id: cannot print only names or real IDs in default format", in spite of that "-Z", which specifies a non-default format. Now, it succeeds and ignores the -n or -r option. The error was that the test for default_format was not updated when I added the new --context (-Z) option in commit v6.9-33-g5320d0f.
Diffstat (limited to 'src')
-rw-r--r--src/id.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/id.c b/src/id.c
index da8142287..158715e2f 100644
--- a/src/id.c
+++ b/src/id.c
@@ -177,7 +177,8 @@ main (int argc, char **argv)
if (just_user + just_group + just_group_list + just_context > 1)
error (EXIT_FAILURE, 0, _("cannot print \"only\" of more than one choice"));
- bool default_format = (just_user + just_group + just_group_list == 0);
+ bool default_format = (just_user + just_group + just_group_list
+ + just_context == 0);
if (default_format && (use_real || use_name))
error (EXIT_FAILURE, 0,