diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-06 14:49:04 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-06 14:49:04 +0000 |
commit | 81a4a0fc28ffef90c6d952755d701a2a852a2942 (patch) | |
tree | 67b59207d5ba58bbe183f980d28799a7ae8966d5 /usr.bin/cvs | |
parent | 28914beef7207fbea9bc164aab7199bc063e5f93 (diff) |
Handle the '-b' and '-x' global options even if we don't support them,
and add support for case insensitivity
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/cvs.c | 20 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/req.c | 18 |
3 files changed, 35 insertions, 6 deletions
diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index b13f0aa52c1..e5ce5c73834 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.c,v 1.10 2004/08/06 13:01:09 jfb Exp $ */ +/* $OpenBSD: cvs.c,v 1.11 2004/08/06 14:49:02 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -55,6 +55,7 @@ int cvs_compress = 0; int cvs_trace = 0; int cvs_nolog = 0; int cvs_readonly = 0; +int cvs_nocase = 0; /* set to 1 to disable case sensitivity on filenames */ /* name of the command we are running */ char *cvs_command; @@ -278,7 +279,7 @@ void usage(void) { fprintf(stderr, - "Usage: %s [-lQqtv] [-d root] [-e editor] [-z level] " + "Usage: %s [-lQqtvx] [-b bindir] [-d root] [-e editor] [-z level] " "command [options] ...\n", __progname); } @@ -313,8 +314,16 @@ main(int argc, char **argv) ((envstr = getenv("EDITOR")) != NULL)) cvs_editor = envstr; - while ((ret = getopt(argc, argv, "d:e:fHlnQqrtvz:")) != -1) { + while ((ret = getopt(argc, argv, "b:d:e:fHlnQqrtvz:")) != -1) { switch (ret) { + case 'b': + /* + * We do not care about the bin directory for RCS files + * as this program has no dependencies on RCS programs, + * so it is only here for backwards compatibility. + */ + cvs_log(LP_NOTICE, "the -b argument is obsolete"); + break; case 'd': cvs_rootstr = optarg; break; @@ -348,6 +357,11 @@ main(int argc, char **argv) exit(0); /* NOTREACHED */ break; + case 'x': + /* + * Kerberos encryption support, kept for compatibility + */ + break; case 'z': cvs_compress = (int)strtol(optarg, &ep, 10); if (*ep != '\0') diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index aadcee2327b..d81172386c4 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.23 2004/08/06 13:01:10 jfb Exp $ */ +/* $OpenBSD: cvs.h,v 1.24 2004/08/06 14:49:03 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -227,6 +227,7 @@ extern char *cvs_command; extern char *cvs_editor; extern int cvs_cmdop; +extern int cvs_nocase; extern CVSFILE *cvs_files; diff --git a/usr.bin/cvs/req.c b/usr.bin/cvs/req.c index cedb3b656da..624fbde9554 100644 --- a/usr.bin/cvs/req.c +++ b/usr.bin/cvs/req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: req.c,v 1.4 2004/08/04 13:55:24 jfb Exp $ */ +/* $OpenBSD: req.c,v 1.5 2004/08/06 14:49:03 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -59,6 +59,7 @@ static int cvs_req_root (int, char *); static int cvs_req_validreq (int, char *); static int cvs_req_validresp (int, char *); static int cvs_req_directory (int, char *); +static int cvs_req_case (int, char *); static int cvs_req_argument (int, char *); static int cvs_req_globalopt (int, char *); static int cvs_req_version (int, char *); @@ -85,7 +86,7 @@ struct cvs_reqhdlr { { NULL }, { NULL }, { NULL }, - { NULL }, + { cvs_req_case }, { NULL }, { cvs_req_argument }, /* 20 */ { cvs_req_argument }, @@ -239,6 +240,19 @@ cvs_req_directory(int reqid, char *line) return (0); } +/* + * cvs_req_case() + * + * Handler for the `Case' requests, which toggles case sensitivity ON or OFF + */ + +static int +cvs_req_case(int reqid, char *line) +{ + cvs_nocase = 1; + return (0); +} + static int cvs_req_argument(int reqid, char *line) |