=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/file.c,v retrieving revision 1.27 retrieving revision 1.28 diff -c -r1.27 -r1.28 *** src/usr.bin/cvs/file.c 2004/08/12 21:05:32 1.27 --- src/usr.bin/cvs/file.c 2004/08/13 12:44:25 1.28 *************** *** 1,4 **** ! /* $OpenBSD: file.c,v 1.27 2004/08/12 21:05:32 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: file.c,v 1.28 2004/08/13 12:44:25 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 245,250 **** --- 245,251 ---- cfp->cf_type = type; cfp->cf_mode = mode; cfp->cf_ddat->cd_root = cvsroot_get(path); + cfp->cf_ddat->cd_repo = strdup(cfp->cf_path); if (type == DT_DIR) { if ((mkdir(path, mode) == -1) || (cvs_mkadmin(cfp, mode) < 0)) { *************** *** 466,471 **** --- 467,474 ---- sizeof(pbuf)) == 0) { cdp->cd_repo = strdup(pbuf); if (cdp->cd_repo == NULL) { + cvs_log(LP_ERRNO, + "failed to dup repository string"); free(cdp); return (-1); } *************** *** 473,479 **** cdp->cd_ent = cvs_ent_open(cf->cf_path, O_RDWR); } - } if (!(flags & CF_RECURSE) || (cf->cf_cvstat == CVS_FST_UNKNOWN)) --- 476,481 ---- *************** *** 786,804 **** cfp->cf_cvstat = CVS_FST_ADDED; else { /* check last modified time */ ! if ((gmtime_r((time_t *)&(st.st_mtime), ! &lmtm) == NULL) || ! (asctime_r(&lmtm, buf) == NULL)) { ! cvs_log(LP_ERR, ! "failed to generate file timestamp"); ! /* fake an up to date file */ ! strlcpy(buf, ent->ce_timestamp, sizeof(buf)); ! } ! len = strlen(buf); ! if ((len > 0) && (buf[len - 1] == '\n')) ! buf[--len] = '\0'; ! ! if (strcmp(buf, ent->ce_timestamp) == 0) cfp->cf_cvstat = CVS_FST_UPTODATE; else cfp->cf_cvstat = CVS_FST_MODIFIED; --- 788,794 ---- cfp->cf_cvstat = CVS_FST_ADDED; else { /* check last modified time */ ! if (ent->ce_mtime == st.st_mtime) cfp->cf_cvstat = CVS_FST_UPTODATE; else cfp->cf_cvstat = CVS_FST_MODIFIED;