=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/file.c,v retrieving revision 1.19 retrieving revision 1.20 diff -c -r1.19 -r1.20 *** src/usr.bin/cvs/file.c 2004/08/03 04:28:15 1.19 --- src/usr.bin/cvs/file.c 2004/08/03 04:41:19 1.20 *************** *** 1,4 **** ! /* $OpenBSD: file.c,v 1.19 2004/08/03 04:28:15 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: file.c,v 1.20 2004/08/03 04:41:19 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 364,369 **** --- 364,370 ---- char fbuf[2048], pbuf[MAXPATHLEN]; struct dirent *ent; CVSFILE *cfp; + struct stat st; struct cvs_dir *cdp; struct cvs_flist dirs; *************** *** 371,384 **** TAILQ_INIT(&dirs); cdp = cf->cf_ddat; - if (cvs_readrepo(cf->cf_path, pbuf, sizeof(pbuf)) == 0) { - cdp->cd_repo = strdup(pbuf); - if (cdp->cd_repo == NULL) { - free(cdp); - return (-1); - } - } - cdp->cd_root = cvsroot_get(cf->cf_path); if (cdp->cd_root == NULL) { cvs_file_freedir(cdp); --- 372,377 ---- *************** *** 388,394 **** if (flags & CF_MKADMIN) cvs_mkadmin(cf, 0755); ! cdp->cd_ent = cvs_ent_open(cf->cf_path, O_RDONLY); fd = open(cf->cf_path, O_RDONLY); if (fd == -1) { --- 381,399 ---- if (flags & CF_MKADMIN) cvs_mkadmin(cf, 0755); ! /* if the CVS administrative directory exists, load the info */ ! snprintf(pbuf, sizeof(pbuf), "%s/" CVS_PATH_CVSDIR, cf->cf_path); ! if ((stat(pbuf, &st) == 0) && S_ISDIR(st.st_mode)) { ! if (cvs_readrepo(cf->cf_path, pbuf, sizeof(pbuf)) == 0) { ! cdp->cd_repo = strdup(pbuf); ! if (cdp->cd_repo == NULL) { ! free(cdp); ! return (-1); ! } ! } ! ! cdp->cd_ent = cvs_ent_open(cf->cf_path, O_RDONLY); ! } fd = open(cf->cf_path, O_RDONLY); if (fd == -1) {