bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

groups bug


From: Eric Blake
Subject: groups bug
Date: Fri, 28 Sep 2007 23:09:30 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

$ groups -- eblake
Users
$ groups eblake other
eblake : Users
other : Users
$ groups eblake --
id: --: No such user

Oops - either this should have output:

eblake : Users
id: --: No such user

because arguments are not re-ordered, therefore the argument eblake ended 
option parsing, or:

Users

because arguments are re-ordered.

This goes with the simpler approach (no re-ordering):

From: Eric Blake <address@hidden>
Date: Fri, 28 Sep 2007 17:07:35 -0600
Subject: [PATCH] Fix 'groups id --'.

* src/groups.sh: Don't lose first argument if later argument is
--.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog     |    5 +++++
 src/groups.sh |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d8bdd87..bfab0e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-28  Eric Blake  <address@hidden>
+
+       * src/groups.sh: Don't lose first argument if later argument is
+       --.
+
 2007-09-27  Jim Meyering  <address@hidden>
 
        Move file-set and hash-triple modules to gnulib.
diff --git a/src/groups.sh b/src/groups.sh
index 54ae918..7afe52e 100755
--- a/src/groups.sh
+++ b/src/groups.sh
@@ -52,6 +52,8 @@ do
     -*)
       echo "$0: invalid option: $arg" >&2
       exit 1 ;;
+    *)
+      break ;;
   esac
 done
 
-- 
1.5.3.2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]