summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/annotate.c
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/cvs/annotate.c
parentafdc6e52f6ba396669fcf1d94f00df5035574531 (diff)
more use of cvs_rcs_getpath();
Diffstat (limited to 'usr.bin/cvs/annotate.c')
-rw-r--r--usr.bin/cvs/annotate.c16
1 files changed, 3 insertions, 13 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)