summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxsa <xsa@openbsd.org>2005-07-14 06:50:50 +0000
committerxsa <xsa@openbsd.org>2005-07-14 06:50:50 +0000
commit3f748f9f98c67b89e7930ecf64413cee44fb1088 (patch)
tree5b9ac34491e8f9704f7e46ff08e140a4f5c15bf1
parentMore bge ids, found in Broadcom's Linux driver. ok brad@ (diff)
downloadwireguard-openbsd-3f748f9f98c67b89e7930ecf64413cee44fb1088.tar.xz
wireguard-openbsd-3f748f9f98c67b89e7930ecf64413cee44fb1088.zip
use cvs_rcs_getpath();
-rw-r--r--usr.bin/cvs/admin.c16
-rw-r--r--usr.bin/cvs/commit.c15
-rw-r--r--usr.bin/cvs/getlog.c15
-rw-r--r--usr.bin/cvs/tag.c15
-rw-r--r--usr.bin/cvs/update.c16
5 files changed, 17 insertions, 60 deletions
diff --git a/usr.bin/cvs/admin.c b/usr.bin/cvs/admin.c
index f7529323999..d273b3baa60 100644
--- a/usr.bin/cvs/admin.c
+++ b/usr.bin/cvs/admin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: admin.c,v 1.19 2005/07/11 08:32:36 xsa Exp $ */
+/* $OpenBSD: admin.c,v 1.20 2005/07/14 06:50:50 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
@@ -356,10 +356,9 @@ cvs_admin_remote(CVSFILE *cf, void *arg)
static int
cvs_admin_local(CVSFILE *cf, void *arg)
{
- int ret, len;
- char *repo, fpath[MAXPATHLEN], rcspath[MAXPATHLEN];
+ int ret;
+ char fpath[MAXPATHLEN], rcspath[MAXPATHLEN];
RCSFILE *rf;
- struct cvsroot *root;
if (cf->cf_type == DT_DIR) {
if (verbosity > 1)
@@ -374,13 +373,8 @@ cvs_admin_local(CVSFILE *cf, void *arg)
cvs_file_getpath(cf, fpath, sizeof(fpath));
- len = snprintf(rcspath, sizeof(rcspath), "%s/%s/%s%s",
- root->cr_dir, repo, cf->cf_name, RCS_FILE_EXT);
- if (len == -1 || len >= (int)sizeof(rcspath)) {
- errno = ENAMETOOLONG;
- cvs_log(LP_ERRNO, "%s", rcspath);
- return (-1);
- }
+ if (cvs_rcs_getpath(cf, rcspath, sizeof(rcspath)) == NULL)
+ return (CVS_EX_DATA);
rf = rcs_open(rcspath, RCS_RDWR);
if (rf == NULL)
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 <jfb@openbsd.org>
* 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);
}
diff --git a/usr.bin/cvs/getlog.c b/usr.bin/cvs/getlog.c
index a6bb25f55cc..69cc464beee 100644
--- a/usr.bin/cvs/getlog.c
+++ b/usr.bin/cvs/getlog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getlog.c,v 1.37 2005/07/11 08:44:16 xsa Exp $ */
+/* $OpenBSD: getlog.c,v 1.38 2005/07/14 06:50:50 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -203,14 +203,12 @@ cvs_getlog_remote(CVSFILE *cf, void *arg)
static int
cvs_getlog_local(CVSFILE *cf, void *arg)
{
- int nrev, l;
+ int nrev;
char rcspath[MAXPATHLEN], numbuf[64];
- char *repo;
RCSFILE *rf;
struct rcs_sym *sym;
struct rcs_delta *rdp;
struct rcs_access *acp;
- struct cvsroot *root;
if (cf->cf_cvstat == CVS_FST_UNKNOWN) {
if (verbosity > 0)
@@ -225,16 +223,9 @@ cvs_getlog_local(CVSFILE *cf, void *arg)
}
nrev = 0;
- root = CVS_DIR_ROOT(cf);
- repo = CVS_DIR_REPO(cf);
- l = snprintf(rcspath, sizeof(rcspath), "%s/%s/%s%s",
- root->cr_dir, repo, CVS_FILE_NAME(cf), RCS_FILE_EXT);
- if (l == -1 || l >= (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 (log_rfonly) {
cvs_printf("%s\n", rcspath);
diff --git a/usr.bin/cvs/tag.c b/usr.bin/cvs/tag.c
index 8b3dfc1c40e..6ffa80dee58 100644
--- a/usr.bin/cvs/tag.c
+++ b/usr.bin/cvs/tag.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tag.c,v 1.24 2005/07/11 10:33:57 xsa Exp $ */
+/* $OpenBSD: tag.c,v 1.25 2005/07/14 06:50:50 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* Copyright (c) 2004 Joris Vink <joris@openbsd.org>
@@ -244,9 +244,7 @@ cvs_tag_remote(CVSFILE *cfp, void *arg)
static int
cvs_tag_local(CVSFILE *cf, void *arg)
{
- int len;
- char *repo, fpath[MAXPATHLEN], rcspath[MAXPATHLEN];
- struct cvsroot *root;
+ char fpath[MAXPATHLEN], rcspath[MAXPATHLEN];
RCSFILE *rf;
RCSNUM *tag_rev;
@@ -264,17 +262,10 @@ cvs_tag_local(CVSFILE *cf, void *arg)
return (0);
}
- repo = CVS_DIR_REPO(cf);
- root = CVS_DIR_ROOT(cf);
tag_rev = cf->cf_lrev;
- len = snprintf(rcspath, sizeof(rcspath), "%s/%s/%s%s",
- root->cr_dir, repo, cf->cf_name, 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|RCS_WRITE);
if (rf == NULL) {
diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c
index 343fc625542..8381c298fba 100644
--- a/usr.bin/cvs/update.c
+++ b/usr.bin/cvs/update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: update.c,v 1.38 2005/07/07 14:27:57 joris Exp $ */
+/* $OpenBSD: update.c,v 1.39 2005/07/14 06:50:50 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -219,15 +219,12 @@ cvs_update_remote(CVSFILE *cf, void *arg)
static int
cvs_update_local(CVSFILE *cf, void *arg)
{
- int ret, l;
- char *repo, fpath[MAXPATHLEN], rcspath[MAXPATHLEN];
+ int ret;
+ char fpath[MAXPATHLEN], rcspath[MAXPATHLEN];
RCSFILE *rf;
- struct cvsroot *root;
ret = 0;
rf = NULL;
- root = CVS_DIR_ROOT(cf);
- repo = CVS_DIR_REPO(cf);
cvs_file_getpath(cf, fpath, sizeof(fpath));
@@ -241,13 +238,8 @@ cvs_update_local(CVSFILE *cf, void *arg)
return (CVS_EX_OK);
}
- l = snprintf(rcspath, sizeof(rcspath), "%s/%s/%s%s",
- root->cr_dir, repo, cf->cf_name, RCS_FILE_EXT);
- if (l == -1 || l >= (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_RDWR);
if (rf == NULL) {