summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-06 20:16:53 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-06 20:16:53 +0000
commit85625c17032332953caf8174c1bdf13f63fe4df2 (patch)
treed4fd60b6d7b77ecfa09d06af33b5d9bf9a9889b8
parentf55ce1bff9dd0fb3974f7c99880a878a6b38350d (diff)
Cleanup and fix a call to cvs_splitpath()
-rw-r--r--usr.bin/cvs/resp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c
index 6649d42a4e8..bef3b42010f 100644
--- a/usr.bin/cvs/resp.c
+++ b/usr.bin/cvs/resp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: resp.c,v 1.2 2004/08/03 05:08:45 jfb Exp $ */
+/* $OpenBSD: resp.c,v 1.3 2004/08/06 20:16:52 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -321,7 +321,9 @@ cvs_resp_statdir(struct cvsroot *root, int type, char *line)
int fd;
char rpath[MAXPATHLEN], statpath[MAXPATHLEN];
- cvs_getln(root, rpath, sizeof(rpath));
+ /* remote directory line */
+ if (cvs_getln(root, rpath, sizeof(rpath)) < 0)
+ return (-1);
snprintf(statpath, sizeof(statpath), "%s/%s", line,
CVS_PATH_STATICENTRIES);
@@ -335,8 +337,8 @@ cvs_resp_statdir(struct cvsroot *root, int type, char *line)
else if (type == CVS_RESP_SETSTATDIR) {
fd = open(statpath, O_CREAT|O_TRUNC|O_WRONLY, 0400);
if (fd == -1) {
- cvs_log(LP_ERRNO, "failed to create %s file",
- CVS_PATH_STATICENTRIES);
+ cvs_log(LP_ERRNO,
+ "failed to set static directory on %s", line);
return (-1);
}
(void)close(fd);
@@ -607,11 +609,10 @@ cvs_resp_updated(struct cvsroot *root, int type, char *line)
static int
cvs_resp_removed(struct cvsroot *root, int type, char *line)
{
- char base[MAXPATHLEN], file[MAXNAMLEN];
+ char base[MAXPATHLEN], *file;
CVSENTRIES *ef;
- cvs_splitpath(line, base, sizeof(base), file, sizeof(file));
-
+ cvs_splitpath(line, base, sizeof(base), &file);
ef = cvs_ent_open(base, O_RDWR);
if (ef == NULL)
return (-1);