diff options
| author | 2004-08-04 13:03:52 +0000 | |
|---|---|---|
| committer | 2004-08-04 13:03:52 +0000 | |
| commit | 1a69abadc85140c373be59c44e1eb5ea9e5e9370 (patch) | |
| tree | 2f4811780d57917064a4a9cf7d5b42637b15591c | |
| parent | Handler for the `Argument' and `Argumentx' requests (diff) | |
| download | wireguard-openbsd-1a69abadc85140c373be59c44e1eb5ea9e5e9370.tar.xz wireguard-openbsd-1a69abadc85140c373be59c44e1eb5ea9e5e9370.zip | |
Handler for the `Global_opt' request
| -rw-r--r-- | usr.bin/cvs/req.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/usr.bin/cvs/req.c b/usr.bin/cvs/req.c index 54c03caa1ce..4bdb507f72c 100644 --- a/usr.bin/cvs/req.c +++ b/usr.bin/cvs/req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: req.c,v 1.2 2004/08/04 12:41:58 jfb Exp $ */ +/* $OpenBSD: req.c,v 1.3 2004/08/04 13:03:52 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -58,6 +58,7 @@ extern int cvs_readonly; static int cvs_req_root (int, char *); static int cvs_req_directory (int, char *); static int cvs_req_argument (int, char *); +static int cvs_req_globalopt (int, char *); static int cvs_req_version (int, char *); @@ -86,7 +87,7 @@ struct cvs_reqhdlr { { NULL }, { cvs_req_argument }, /* 20 */ { cvs_req_argument }, - { NULL }, + { cvs_req_globalopt }, { NULL }, { NULL }, { NULL }, @@ -240,6 +241,43 @@ cvs_req_argument(int reqid, char *line) static int +cvs_req_globalopt(int reqid, char *line) +{ + if ((*line != '-') || (*(line + 2) != '\0')) { + cvs_log(LP_ERR, + "invalid `Global_option' request format"); + return (-1); + } + + switch (*(line + 1)) { + case 'l': + cvs_nolog = 1; + break; + case 'n': + break; + case 'Q': + verbosity = 0; + break; + case 'q': + if (verbosity > 1) + verbosity = 1; + break; + case 'r': + cvs_readonly = 1; + break; + case 't': + cvs_trace = 1; + break; + default: + cvs_log(LP_ERR, "unknown global option `%s'", line); + return (-1); + } + + return (0); +} + + +static int cvs_req_version(int reqid, char *line) { cvs_printf("%s\n", CVS_VERSION); |
