Split the --user delimiter skipping across two lines and add comments.
authorFabian Keil <fk@fabiankeil.de>
Tue, 26 Apr 2011 16:55:08 +0000 (16:55 +0000)
committerFabian Keil <fk@fabiankeil.de>
Tue, 26 Apr 2011 16:55:08 +0000 (16:55 +0000)
jcc.c

diff --git a/jcc.c b/jcc.c
index ac20b22..93d859d 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.348 2011/04/26 16:50:11 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.349 2011/04/26 16:53:21 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -2961,7 +2961,12 @@ int main(int argc, char **argv)
          group_name = strchr(user_arg, '.');
          if (NULL != group_name)
          {
          group_name = strchr(user_arg, '.');
          if (NULL != group_name)
          {
-            *group_name++ = '\0';
+            /* Nul-terminate the user name */
+            *group_name = '\0';
+
+            /* Skip the former delimiter to actually reach the group name */
+            group_name++;
+
             grp = getgrnam(group_name);
             if (NULL == grp)
             {
             grp = getgrnam(group_name);
             if (NULL == grp)
             {