From 3f748f9f98c67b89e7930ecf64413cee44fb1088 Mon Sep 17 00:00:00 2001 From: xsa Date: Thu, 14 Jul 2005 06:50:50 +0000 Subject: use cvs_rcs_getpath(); --- usr.bin/cvs/commit.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'usr.bin/cvs/commit.c') diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index 5b82318a674..0659d7dede0 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.39 2005/07/12 07:12:13 xsa Exp $ */ +/* $OpenBSD: commit.c,v 1.40 2005/07/14 06:50:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -261,10 +261,7 @@ cvs_commit_remote(CVSFILE *cf, void *arg) static int cvs_commit_local(CVSFILE *cf, void *arg) { - int len; char fpath[MAXPATHLEN], rcspath[MAXPATHLEN]; - char *repo; - struct cvsroot *root; if (cf->cf_type == DT_DIR) { if (verbosity > 1) @@ -272,18 +269,10 @@ cvs_commit_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, fpath, 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); - } return (0); } -- cgit v1.2.3-59-g8ed1b