summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2005-07-14 06:55:00 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2005-07-14 06:55:00 +0000
commitecc7dd17d4d60d9626ff978f378db0be0933c8ed (patch)
tree0f6a7daecff9f5f251ef38e7fde32f0bd33817a9 /usr.bin
parentafdc6e52f6ba396669fcf1d94f00df5035574531 (diff)
more use of cvs_rcs_getpath();
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/annotate.c16
-rw-r--r--usr.bin/cvs/status.c14
2 files changed, 5 insertions, 25 deletions
diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c
index 0c51870a0ca..700051a1d40 100644
--- a/usr.bin/cvs/annotate.c
+++ b/usr.bin/cvs/annotate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: annotate.c,v 1.20 2005/07/11 18:05:09 joris Exp $ */
+/* $OpenBSD: annotate.c,v 1.21 2005/07/14 06:54:59 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -181,29 +181,19 @@ cvs_annotate_remote(CVSFILE *cf, void *arg)
static int
cvs_annotate_local(CVSFILE *cf, void *arg)
{
- int len;
- char *repo, fpath[MAXPATHLEN], rcspath[MAXPATHLEN];
+ char fpath[MAXPATHLEN], rcspath[MAXPATHLEN];
RCSFILE *rf;
- struct cvsroot *root;
if (cf->cf_type == DT_DIR)
return (0);
- root = CVS_DIR_ROOT(cf);
- repo = CVS_DIR_REPO(cf);
-
cvs_file_getpath(cf, fpath, sizeof(fpath));
if (cf->cf_cvstat == CVS_FST_UNKNOWN)
return (0);
- len = snprintf(rcspath, sizeof(rcspath), "%s/%s/%s%s",
- root->cr_dir, repo, CVS_FILE_NAME(cf), RCS_FILE_EXT);
- if (len == -1 || len >= (int)sizeof(rcspath)) {
- errno = ENAMETOOLONG;
- cvs_log(LP_ERRNO, "%s", rcspath);
+ if (cvs_rcs_getpath(cf, rcspath, sizeof(rcspath)) == NULL)
return (CVS_EX_DATA);
- }
rf = rcs_open(rcspath, RCS_READ);
if (rf == NULL)
diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c
index 9c0ea493e78..c4f102cf516 100644
--- a/usr.bin/cvs/status.c
+++ b/usr.bin/cvs/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.39 2005/07/10 13:58:19 xsa Exp $ */
+/* $OpenBSD: status.c,v 1.40 2005/07/14 06:54:59 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -180,9 +180,7 @@ cvs_status_local(CVSFILE *cf, void *arg)
size_t n;
char buf[MAXNAMLEN], fpath[MAXPATHLEN], rcspath[MAXPATHLEN];
char numbuf[64], timebuf[32];
- char *repo;
RCSFILE *rf;
- struct cvsroot *root;
if (cf->cf_type == DT_DIR) {
if (verbosity > 1)
@@ -190,18 +188,10 @@ cvs_status_local(CVSFILE *cf, void *arg)
return (0);
}
- root = CVS_DIR_ROOT(cf);
- repo = CVS_DIR_REPO(cf);
-
cvs_file_getpath(cf, fpath, sizeof(fpath));
- len = snprintf(rcspath, sizeof(rcspath), "%s/%s/%s%s",
- root->cr_dir, repo, CVS_FILE_NAME(cf), RCS_FILE_EXT);
- if (len == -1 || len >= (int)sizeof(rcspath)) {
- errno = ENAMETOOLONG;
- cvs_log(LP_ERRNO, "%s", rcspath);
+ if (cvs_rcs_getpath(cf, rcspath, sizeof(rcspath)) == NULL)
return (CVS_EX_DATA);
- }
if (cf->cf_cvstat != CVS_FST_UNKNOWN &&
cf->cf_cvstat != CVS_FST_ADDED) {