if (f_nonprint) prcopy(cur->fts_name, cur->fts_name, cur->fts_namelen);
display(p, list)	FTSENT *p, *list;{	struct stat *sp;	DISPLAY d;	FTSENT *cur;	NAMES *np;	u_quad_t maxsize;	u_long btotal, maxblock, maxinode, maxlen, maxnlink;	int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser;	int entries, needstats;	char *user, *group, buf[20];	/* 32 bits == 10 digits */	char nuser[12], ngroup[12];	char *flags = NULL;	/*	 * If list is NULL there are two possibilities: that the parent	 * directory p has no children, or that fts_children() returned an	 * error.  We ignore the error case since it will be replicated	 * on the next call to fts_read() on the post-order visit to the	 * directory p, and will be signalled in traverse().	 */	if (list == NULL)		return;	needstats = f_inode || f_longform || f_size;	flen = 0;	btotal = maxblock = maxinode = maxlen = maxnlink = 0;	bcfile = 0;	maxuser = maxgroup = maxflags = 0;	maxsize = 0;	for (cur = list, entries = 0; cur; cur = cur->fts_link) {		if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) {			warnx("%s: %s",			    cur->fts_name, strerror(cur->fts_errno));			cur->fts_number = NO_PRINT;			rval = 1;			continue;		}		/*		 * P is NULL if list is the argv list, to which different rules		 * apply.		 */		if (p == NULL) {			/* Directories will be displayed later. */			if (cur->fts_info == FTS_D && !f_listdir) {				cur->fts_number = NO_PRINT;				continue;			}		} else {			/* Only display dot file if -a/-A set. */			if (cur->fts_name[0] == '.' && !f_listdot) {				cur->fts_number = NO_PRINT;				continue;			}		}		if (f_nonprint)			prcopy(cur->fts_name, cur->fts_name, cur->fts_namelen);		if (cur->fts_namelen > maxlen)			maxlen = cur->fts_namelen;		if (needstats) {			sp = cur->fts_statp;			if (sp->st_blocks > maxblock)				maxblock = sp->st_blocks;			if (sp->st_ino > maxinode)				maxinode = sp->st_ino;			if (sp->st_nlink > maxnlink)				maxnlink = sp->st_nlink;			if (sp->st_size > maxsize)				maxsize = sp->st_size;			btotal += sp->st_blocks;			if (f_longform) {				if (f_numericonly) {					snprintf(nuser, 12, "%u", sp->st_uid);					snprintf(ngroup, 12, "%u", sp->st_gid);					user = nuser;					group = ngroup;				} else {					user = user_from_uid(sp->st_uid, 0);					group = group_from_gid(sp->st_gid, 0);				}				if ((ulen = strlen(user)) > maxuser)					maxuser = ulen;				if ((glen = strlen(group)) > maxgroup)					maxgroup = glen;				if (f_flags) {					flags =					    flags_to_string(sp->st_flags, "-");					if ((flen = strlen(flags)) > maxflags)						maxflags = flen;				} else					flen = 0;				if ((np = malloc(sizeof(NAMES) +				    ulen + glen + flen + 3)) == NULL)					err(1, NULL);				np->user = &np->data[0];				(void)strcpy(np->user, user);				np->group = &np->data[ulen + 1];				(void)strcpy(np->group, group);				if (S_ISCHR(sp->st_mode) ||				    S_ISBLK(sp->st_mode))					bcfile = 1;				if (f_flags) {					np->flags = &np->data[ulen + glen + 2];				  	(void)strcpy(np->flags, flags);				}				cur->fts_pointer = np;			}		}		++entries;	}	if (!entries)		return;	d.list = list;	d.entries = entries;	d.maxlen = maxlen;	if (needstats) {		d.bcfile = bcfile;		d.btotal = btotal;		(void)snprintf(buf, sizeof(buf), "%lu", maxblock);		d.s_block = strlen(buf);		d.s_flags = maxflags;		d.s_group = maxgroup;		(void)snprintf(buf, sizeof(buf), "%lu", maxinode);		d.s_inode = strlen(buf);		(void)snprintf(buf, sizeof(buf), "%lu", maxnlink);		d.s_nlink = strlen(buf);		(void)snprintf(buf, sizeof(buf), "%qu", maxsize);		d.s_size = strlen(buf);		d.s_user = maxuser;	}	printfcn(&d);	output = 1;	if (f_longform)		for (cur = list; cur; cur = cur->fts_link)			free(cur->fts_pointer);}