summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-12-28 20:46:14 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-12-28 20:46:14 +0000
commit4861b3654fe0c5c6d961e339b28c6a7e31ebd826 (patch)
tree18c0b9da6ede710e3955663cbff2dc8174e05951
parentb4c190a2dd37528ef5de04cb65b4b98303f511a7 (diff)
handler for the Set request
-rw-r--r--usr.bin/cvs/req.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/usr.bin/cvs/req.c b/usr.bin/cvs/req.c
index 8f0e0026181..c78319433b6 100644
--- a/usr.bin/cvs/req.c
+++ b/usr.bin/cvs/req.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: req.c,v 1.8 2004/12/19 17:32:55 jfb Exp $ */
+/* $OpenBSD: req.c,v 1.9 2004/12/28 20:46:13 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -55,6 +55,7 @@ extern int cvs_nolog;
extern int cvs_readonly;
+static int cvs_req_set (int, char *);
static int cvs_req_root (int, char *);
static int cvs_req_validreq (int, char *);
static int cvs_req_validresp (int, char *);
@@ -103,7 +104,7 @@ struct cvs_reqhdlr {
{ NULL },
{ NULL },
{ NULL },
- { NULL },
+ { cvs_req_set },
{ NULL },
{ NULL },
{ NULL },
@@ -191,6 +192,24 @@ cvs_req_root(int reqid, char *line)
static int
+cvs_req_set(int reqid, char *line)
+{
+ char *cp;
+
+ cp = strchr(line, '=');
+ if (cp == NULL) {
+ cvs_log(LP_ERR, "error in Set request "
+ "(no = in variable assignment)");
+ return (-1);
+ }
+
+ if (cvs_var_set(line, cp) < 0)
+ return (-1);
+ return (0);
+}
+
+
+static int
cvs_req_validreq(int reqid, char *line)
{
char *vreq;