diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-03-29 03:10:28 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-03-29 03:10:28 +0000 |
commit | 9ea5c91ee37bce45179cdaea197128ddd1972e1d (patch) | |
tree | c02372122e874f51a94d6460fd847de828ef6a8d /usr.bin/cvs/cmd.c | |
parent | a0d297188e3c0fe771377a53830e740fbaa07adc (diff) |
allow cmd_options to be NULL, so that commands which
have no options will work fine.
Diffstat (limited to 'usr.bin/cvs/cmd.c')
-rw-r--r-- | usr.bin/cvs/cmd.c | 12 |
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); |