Both should only output the groups.
---
 toys/posix/id.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
From 4e16de4e367b288e7b65ba6c1043fd54fa4566e4 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Fri, 29 Sep 2017 15:20:26 -0700
Subject: [PATCH] Fix groups(1) and id -G.

Both should only output the groups.
---
 toys/posix/id.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/posix/id.c b/toys/posix/id.c
index 4b732b1..daa4b9e 100644
--- a/toys/posix/id.c
+++ b/toys/posix/id.c
@@ -107,7 +107,7 @@ static void do_id(char *username)
   grp = xgetgrgid(i ? gid : egid);
   if (flags & FLAG_g) s_or_u(grp->gr_name, grp->gr_gid, 1);
 
-  if (!(toys.optflags&(FLAG_g|FLAG_Z))) {
+  if (!(toys.optflags&(FLAG_G|FLAG_g|FLAG_Z))) {
     showid("uid=", pw->pw_uid, pw->pw_name);
     showid(" gid=", grp->gr_gid, grp->gr_name);
 
-- 
2.14.2.822.g60be5d43e6-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to