parse(): make reentrant

This commit is contained in:
William Pitcock 2010-10-24 21:02:32 -05:00
parent 5f8934ea22
commit 819dd2d287

View file

@ -45,11 +45,6 @@
static struct Dictionary *cmd_dict = NULL; static struct Dictionary *cmd_dict = NULL;
struct Dictionary *alias_dict = NULL; struct Dictionary *alias_dict = NULL;
/*
* NOTE: parse() should not be called recursively by other functions!
*/
static char *sender;
/* parv[0] is not used, and parv[LAST] == NULL */ /* parv[0] is not used, and parv[LAST] == NULL */
static char *para[MAXPARA + 2]; static char *para[MAXPARA + 2];
@ -117,12 +112,13 @@ string_to_array(char *string, char **parv)
/* parse() /* parse()
* *
* given a raw buffer, parses it and generates parv, parc and sender * given a raw buffer, parses it and generates parv and parc
*/ */
void void
parse(struct Client *client_p, char *pbuffer, char *bufend) parse(struct Client *client_p, char *pbuffer, char *bufend)
{ {
struct Client *from = client_p; struct Client *from = client_p;
char *sender;
char *ch; char *ch;
char *s; char *s;
char *end; char *end;