ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/src/commandtree.C
(Generate patch)

Comparing ermyth/src/commandtree.C (file contents):
Revision 1.4 by pippijn, Wed Aug 29 08:04:33 2007 UTC vs.
Revision 1.5 by pippijn, Wed Aug 29 21:01:18 2007 UTC

2 * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team 2 * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
3 * Rights to this code are as documented in doc/pod/gplicense.pod. 3 * Rights to this code are as documented in doc/pod/gplicense.pod.
4 * 4 *
5 * Commandtree manipulation routines. 5 * Commandtree manipulation routines.
6 * 6 *
7 * $Id: commandtree.C,v 1.4 2007/08/29 08:04:33 pippijn Exp $ 7 * $Id: commandtree.C,v 1.5 2007/08/29 21:01:18 pippijn Exp $
8 */ 8 */
9 9
10#include <algorithm> 10#include <algorithm>
11 11
12#include "atheme.h" 12#include "atheme.h"
13#include "users.h" 13#include "users.h"
14#include "privs.h" 14#include "privs.h"
15 15
16static char const rcsid[] = "$Id: commandtree.C,v 1.4 2007/08/29 08:04:33 pippijn Exp $"; 16static char const rcsid[] = "$Id: commandtree.C,v 1.5 2007/08/29 21:01:18 pippijn Exp $";
17 17
18cmdvec null_cmdvec; 18cmdvec null_cmdvec;
19 19
20struct cmd_eq 20struct cmd_eq
21{ 21{
141 141
142void 142void
143command_exec_split (service_t *svs, sourceinfo_t *si, char const * const cmd, char const * const text, cmdvec &commandlist) 143command_exec_split (service_t *svs, sourceinfo_t *si, char const * const cmd, char const * const text, cmdvec &commandlist)
144{ 144{
145 size_t i; 145 size_t i;
146 char *parv[20]; 146 char *parv[20] = { 0 };
147 command_t const *c; 147 command_t const *c;
148 148
149 if ((c = commandlist.find (cmd))) 149 if ((c = commandlist.find (cmd)))
150 { 150 {
151 unsigned const parc = sjtoken (text, ' ', parv, c->maxparc); 151 unsigned const parc = sjtoken (text, ' ', parv, c->maxparc);
152 for (i = parc; i < (sizeof (parv) / sizeof (parv[0])); i++)
153 parv[i] = NULL;
154 c->exec (svs, si, parc, parv); 152 c->exec (svs, si, parc, parv);
155 } 153 }
156 else 154 else
157 notice (svs->name, si->su->nick, _("Invalid command. Use \2/%s%s help\2 for a command listing."), (ircd->uses_rcommand == false) ? "msg " : "", svs->disp); 155 notice (svs->name, si->su->nick, _("Invalid command. Use \2/%s%s help\2 for a command listing."), (ircd->uses_rcommand == false) ? "msg " : "", svs->disp);
158} 156}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines