version 1.26, 2015/01/20 16:59:07 |
version 1.27, 2015/10/16 17:56:07 |
|
|
gname = *argv; |
gname = *argv; |
h = hash(gname); |
h = hash(gname); |
if ((gh = findgroup(gname)) == NULL) { |
if ((gh = findgroup(gname)) == NULL) { |
if ((gh = (struct grouphead *)calloc(1, sizeof(*gh))) == NULL) |
if ((gh = calloc(1, sizeof(*gh))) == NULL) |
errx(1, "Out of memory"); |
err(1, "calloc"); |
gh->g_name = vcopy(gname); |
gh->g_name = vcopy(gname); |
gh->g_list = NULL; |
gh->g_list = NULL; |
gh->g_link = groups[h]; |
gh->g_link = groups[h]; |
|
|
*/ |
*/ |
|
|
for (ap = argv+1; *ap != NULL; ap++) { |
for (ap = argv+1; *ap != NULL; ap++) { |
if ((gp = (struct group *)calloc(1, sizeof(*gp))) == NULL) |
if ((gp = calloc(1, sizeof(*gp))) == NULL) |
errx(1, "Out of memory"); |
err(1, "calloc"); |
gp->ge_name = vcopy(*ap); |
gp->ge_name = vcopy(*ap); |
gp->ge_link = gh->g_list; |
gp->ge_link = gh->g_list; |
gh->g_list = gp; |
gh->g_list = gp; |
|
|
} |
} |
if (altnames != 0) |
if (altnames != 0) |
(void)free(altnames); |
(void)free(altnames); |
if ((altnames = (char **)calloc(c, sizeof(char *))) == NULL) |
if ((altnames = calloc(c, sizeof(char *))) == NULL) |
errx(1, "Out of memory"); |
err(1, "calloc"); |
for (ap = namelist, ap2 = altnames; *ap; ap++, ap2++) { |
for (ap = namelist, ap2 = altnames; *ap; ap++, ap2++) { |
if ((*ap2 = strdup(*ap)) == NULL) |
if ((*ap2 = strdup(*ap)) == NULL) |
errx(1, "Out of memory"); |
err(1, "strdup"); |
} |
} |
*ap2 = 0; |
*ap2 = 0; |
return(0); |
return(0); |