From cf32f60d0deaeefbac2259f31bcc33224c00f407 Mon Sep 17 00:00:00 2001 From: xsa Date: Thu, 14 Jul 2005 06:54:59 +0000 Subject: more use of cvs_rcs_getpath(); --- usr.bin/cvs/annotate.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'usr.bin/cvs/annotate.c') 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 * 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) -- cgit v1.2.3-59-g8ed1b