summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-03-29 03:10:28 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-03-29 03:10:28 +0000
commit9ea5c91ee37bce45179cdaea197128ddd1972e1d (patch)
treec02372122e874f51a94d6460fd847de828ef6a8d
parenta0d297188e3c0fe771377a53830e740fbaa07adc (diff)
allow cmd_options to be NULL, so that commands which
have no options will work fine.
-rw-r--r--usr.bin/cvs/cmd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/cvs/cmd.c b/usr.bin/cvs/cmd.c
index 02ec2a7c1be..91ec5b8df54 100644
--- a/usr.bin/cvs/cmd.c
+++ b/usr.bin/cvs/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.2 2005/03/28 17:17:38 joris Exp $ */
+/* $OpenBSD: cmd.c,v 1.3 2005/03/29 03:10:27 joris Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -51,11 +51,13 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv)
struct cvsroot *root;
struct cvs_cmd_info *c = cmd->cmd_info;
- if ((ret = c->cmd_options(cmd->cmd_opts, argc, argv, &i)) < 0)
- return (ret);
+ if (c->cmd_options != NULL) {
+ if ((ret = c->cmd_options(cmd->cmd_opts, argc, argv, &i)) < 0)
+ return (ret);
- argc -= i;
- argv += i;
+ argc -= i;
+ argv += i;
+ }
if ((c->cmd_flags & CVS_CMD_ALLOWSPEC) && argc != 0)
cvs_files = cvs_file_getspec(argv, argc, 0);