while (dp = readdir(d)) {
while ((dp = readdir(d))) {
static int senddir(rname, opts, stb, user, group, destdir)	char *rname;	opt_t opts;	struct stat *stb;	char *user, *group;	int destdir;{	DIRENTRY *dp;	DIR *d;	char *optarget, *cp;	int len;	int didupdate = 0;	/*	 * Don't descend into directory	 */	if (IS_ON(opts, DO_NODESCEND))		return(0);	if ((d = opendir(target)) == NULL) {		error("%s: opendir failed: %s", target, SYSERR);		return(-1);	}	/*	 * Send recvdir command in recvit() format.	 */	(void) sendcmd(C_RECVDIR, "%o %04o 0 0 0 %s %s %s", 		       opts, stb->st_mode & 07777, user, group, rname);	if (response() < 0)		return(-1);	if (IS_ON(opts, DO_REMOVE))		if (rmchk(opts) > 0)			++didupdate;		optarget = ptarget;	len = ptarget - target;	while (dp = readdir(d)) {		if (!strcmp(dp->d_name, ".") ||		    !strcmp(dp->d_name, ".."))			continue;		if (len + 1 + (int) strlen(dp->d_name) >= MAXPATHLEN - 1) {			error("%s/%s: Name too long", target,			      dp->d_name);			continue;		}		ptarget = optarget;		if (ptarget[-1] != '/')			*ptarget++ = '/';		cp = dp->d_name;		while (*ptarget++ = *cp++)			;		ptarget--;		if (sendit(dp->d_name, opts, destdir) > 0)			didupdate = 1;	}	(void) closedir(d);	(void) sendcmd(C_END, NULL);	(void) response();	ptarget = optarget;	*ptarget = CNULL;	return(didupdate);}