diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-06-02 20:12:07 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-06-02 20:12:07 +0000 |
commit | a5ae3a5a3d0afd361e1c29e3838bfc81fda0b726 (patch) | |
tree | 4d473b7e99595e4048d1c68c5c2f006d73750f11 /usr.bin/cvs/cmd.c | |
parent | c2b861c0e32dd295ee7538db6b2aac4dd7c87de2 (diff) |
handle commands which do not have any init callback a bit
better, eliminates the use of dummy functions.
OK jfb@
Diffstat (limited to 'usr.bin/cvs/cmd.c')
-rw-r--r-- | usr.bin/cvs/cmd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/cvs/cmd.c b/usr.bin/cvs/cmd.c index ddd4fba5001..7236fbc4476 100644 --- a/usr.bin/cvs/cmd.c +++ b/usr.bin/cvs/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.22 2005/05/31 08:58:47 xsa Exp $ */ +/* $OpenBSD: cmd.c,v 1.23 2005/06/02 20:12:06 joris Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -162,14 +162,15 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) if (cmd->cmd_op == CVS_OP_SERVER) return cvs_server(argc, argv); + i = 1; if (cmd->cmd_init != NULL) { if ((ret = (*cmd->cmd_init)(cmd, argc, argv, &i)) != 0) return (ret); - - argc -= i; - argv += i; } + argc -= i; + argv += i; + if (!(cmd->cmd_flags & CVS_CMD_ALLOWSPEC) && (argc > 0)) return (CVS_EX_USAGE); |