From e4603e3d273a53437886e070720eae9af77ea922 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 11 Jan 2016 22:28:55 -0600 Subject: [PATCH] parse: implement reconstruct_parv() --- extensions/m_identify.c | 15 --------------- include/parse.h | 1 + ircd/parse.c | 12 ++++++++++++ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/extensions/m_identify.c b/extensions/m_identify.c index f2450a6a..b2385408 100644 --- a/extensions/m_identify.c +++ b/extensions/m_identify.c @@ -49,8 +49,6 @@ #define SVS_chanserv_NICK "ChanServ" #define SVS_nickserv_NICK "NickServ" -char *reconstruct_parv(int parc, const char *parv[]); - static int m_identify(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); struct Message identify_msgtab = { @@ -65,19 +63,6 @@ mapi_clist_av1 identify_clist[] = { DECLARE_MODULE_AV1(identify, NULL, NULL, identify_clist, NULL, NULL, "$Revision: 2729 $"); -char *reconstruct_parv(int parc, const char *parv[]) -{ - static char tmpbuf[BUFSIZE]; int i; - - rb_strlcpy(tmpbuf, parv[0], BUFSIZE); - for (i = 1; i < parc; i++) - { - rb_strlcat(tmpbuf, " ", BUFSIZE); - rb_strlcat(tmpbuf, parv[i], BUFSIZE); - } - return tmpbuf; -} - static int m_identify(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { const char *nick; diff --git a/include/parse.h b/include/parse.h index 921bfe6f..420c05d1 100644 --- a/include/parse.h +++ b/include/parse.h @@ -39,6 +39,7 @@ extern void clear_hash_parse(void); extern void mod_add_cmd(struct Message *msg); extern void mod_del_cmd(struct Message *msg); extern void report_messages(struct Client *); +extern char *reconstruct_parv(int parc, const char *parv[]) extern struct Dictionary *alias_dict; diff --git a/ircd/parse.c b/ircd/parse.c index 84132c82..9ddd73b7 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -61,6 +61,18 @@ static char buffer[1024]; /* turn a string into a parc/parv pair */ +char *reconstruct_parv(int parc, const char *parv[]) +{ + static char tmpbuf[BUFSIZE]; int i; + + rb_strlcpy(tmpbuf, parv[0], BUFSIZE); + for (i = 1; i < parc; i++) + { + rb_strlcat(tmpbuf, " ", BUFSIZE); + rb_strlcat(tmpbuf, parv[i], BUFSIZE); + } + return tmpbuf; +} static inline int string_to_array(char *string, char **parv)