If the --user argument user[.group] contains a dot, always bail out if no group has...
authorFabian Keil <fk@fabiankeil.de>
Tue, 26 Apr 2011 16:48:04 +0000 (16:48 +0000)
committerFabian Keil <fk@fabiankeil.de>
Tue, 26 Apr 2011 16:48:04 +0000 (16:48 +0000)
Previously the intended, but undocumented, behaviour was to
try interpreting the whole argument as user name, but the
detection was flawed and checked for '0' isntead of '\0',
thus merely preventing group names beginning with a zero.

Remove the incorrect check instead of fixing it to get
the documented behaviour.

jcc.c

diff --git a/jcc.c b/jcc.c
index ab29cfa..9dfe364 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.344 2011/03/27 13:58:09 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.345 2011/04/19 13:00:47 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -2950,7 +2950,7 @@ int main(int argc, char **argv)
       {
          if (++argc_pos == argc) usage(argv[argc_pos]);
 
-         if ((NULL != (p = strchr(argv[argc_pos], '.'))) && *(p + 1) != '0')
+         if (NULL != (p = strchr(argv[argc_pos], '.')))
          {
             *p++ = '\0';
             if (NULL == (grp = getgrnam(p)))