FreeBSD/usr.sbin/pw/pw_group.c
/*
 * Delete requested members from a group.
 */
Delete requested members from a group.
Delete requested members from a group .
static void
delete_members(struct group *grp, char *list)
{
	char *p;
	int k;
	if (grp->gr_mem == NULL)
		return;
	for (p = strtok(list, ", \t"); p != NULL; p = strtok(NULL, ", \t")) {
		for (k = 0; grp->gr_mem[k] != NULL; k++) {
			if (strcmp(grp->gr_mem[k], p) == 0)
				break;
		}
		if (grp->gr_mem[k] == NULL) 
			continue;
		for (; grp->gr_mem[k] != NULL; k++)
			grp->gr_mem[k] = grp->gr_mem[k+1];
	}
}
static void delete_members ( struct group * grp , char * list ) { char * p ; int k ; if ( grp -> gr_mem == NULL ) return ; for ( p = strtok ( list , " \t " ) ; p != NULL ; p = strtok ( NULL , " \t " ) ) { for ( k = 0 ; grp -> gr_mem [ k ] != NULL ; k ++ ) { if ( strcmp ( grp -> gr_mem [ k ] , p ) == 0 ) break ; } if ( grp -> gr_mem [ k ] == NULL ) continue ; for ( ; grp -> gr_mem [ k ] != NULL ; k ++ ) grp -> gr_mem [ k ] = grp -> gr_mem [ k + 1 ] ; } }
Delete requested members from a group.
Delete requested members from a group .
/* No match */