if ((cfp->cf_tag = cvs_strdup(ent->ce_tag)) == NULL) { cvs_file_free(cfp); return (NULL);
if (ent->ce_tag != NULL) { if ((cfp->cf_tag = cvs_strdup(ent->ce_tag)) == NULL) { cvs_file_free(cfp); return (NULL); }
cvs_file_lget(const char *path, int flags, CVSFILE *parent, struct cvs_ent *ent){	int ret, cwd;	u_int type;	struct stat st;	CVSFILE *cfp;	type = DT_UNKNOWN;	cwd = (strcmp(path, ".") == 0) ? 1 : 0;	ret = stat(path, &st);	if (ret == 0)		type = IFTODT(st.st_mode);	if ((cfp = cvs_file_alloc(path, type)) == NULL)		return (NULL);	cfp->cf_parent = parent;	if ((cfp->cf_type == DT_DIR) && (cfp->cf_parent == NULL))		cfp->cf_flags |= CVS_DIRF_BASE;	if (ret == 0) {		cfp->cf_mode = st.st_mode & ACCESSPERMS;		if (cfp->cf_type == DT_REG)			cfp->cf_mtime = st.st_mtime;		if (ent == NULL)			cfp->cf_cvstat = (cwd == 1) ?			    CVS_FST_UPTODATE : CVS_FST_UNKNOWN;		else {			/* always show directories as up-to-date */			if (ent->ce_type == CVS_ENT_DIR)				cfp->cf_cvstat = CVS_FST_UPTODATE;			else if (rcsnum_cmp(ent->ce_rev, cvs_addedrev, 2) == 0)				cfp->cf_cvstat = CVS_FST_ADDED;			else {				/* check last modified time */				if (ent->ce_mtime >= (time_t)st.st_mtime)					cfp->cf_cvstat = CVS_FST_UPTODATE;				else					cfp->cf_cvstat = CVS_FST_MODIFIED;			}		}	} else {		if (ent == NULL) {			cvs_log(LP_ERR, "no Entry and no file for `%s'",			    CVS_FILE_NAME(cfp));			cvs_file_free(cfp);			return (NULL);		} else			cfp->cf_cvstat = CVS_FST_LOST;	}	if (ent != NULL) {		/* steal the RCSNUM */		cfp->cf_lrev = ent->ce_rev;		if ((cfp->cf_tag = cvs_strdup(ent->ce_tag)) == NULL) {			cvs_file_free(cfp);			return (NULL);		}		ent->ce_rev = NULL;	}	if ((cfp->cf_type == DT_DIR) && (cvs_file_getdir(cfp, flags) < 0)) {		cvs_file_free(cfp);		return (NULL);	}	return (cfp);}