2000-04-28 Kevin L. Mitchell <klmitch@mit.edu>
+ * ircd/ircd_reply.c (send_reply): fix a slight bug...
+
+ * ircd/s_numeric.c (do_numeric): use new sendcmdto_* functions,
+ kinda hackish...
+
+ * ircd/parse.c (parse_server): argument wrangling to make
+ processing in do_numeric a little easier to deal with
+
* ircd/s_serv.c (server_estab): SERVER should come from
acptr->serv->up, not &me
#
# ChangeLog for ircu2.10.11
#
-# $Id: ChangeLog,v 1.110 2000-04-28 15:34:34 kev Exp $
+# $Id: ChangeLog,v 1.111 2000-04-28 16:16:06 kev Exp $
#
# Insert new changes at beginning of the change list.
#
assert(0 != vd.vd_format);
/* build buffer */
- ircd_snprintf(to, sndbuf, sizeof(sndbuf) - 2, "%:#C %s %C %v", &me, num->str,
- to, &vd);
+ ircd_snprintf(to->from, sndbuf, sizeof(sndbuf) - 2, "%:#C %s %C %v", &me,
+ num->str, to, &vd);
va_end(vd.vd_args);
if (len == 3 && IsDigit(*ch))
{
numeric = (*ch - '0') * 100 + (*(ch + 1) - '0') * 10 + (*(ch + 2) - '0');
- paramcount = MAXPARA;
+ paramcount = 2; /* destination, and the rest of it */
ServerStats->is_num++;
mptr = NULL; /* Init. to avoid stupid compiler warning :/ */
}
* The rest is single parameter--can
* include blanks also.
*/
- para[++i] = s + 1;
+ if (numeric)
+ para[++i] = s; /* preserve the colon to make do_numeric happy */
+ else
+ para[++i] = s + 1;
break;
}
para[++i] = s;
#include "client.h"
#include "hash.h"
#include "ircd.h"
+#include "ircd_snprintf.h"
#include "numnicks.h"
#include "send.h"
#include "struct.h"
-static char buffer[1024];
-
/*
* do_numeric()
* Rewritten by Nemesi, Jan 1999, to support numeric nicks in parv[1]
{
struct Client *acptr = 0;
struct Channel *achptr = 0;
- char *p, *b;
- int i;
+ char num[4];
/* Avoid trash, we need it to come from a server and have a target */
if ((parc < 2) || !IsServer(sptr))
if (numeric < 100)
numeric += 100;
- /* Rebuild the buffer with all the parv[] without wasting cycles :) */
- b = buffer;
- if (parc > 2)
- {
- for (i = 2; i < (parc - 1); i++)
- for (*b++ = ' ', p = parv[i]; *p; p++)
- *b++ = *p;
- for (*b++ = ' ', *b++ = ':', p = parv[parc - 1]; *p; p++)
- *b++ = *p;
- }
- *b = '\000';
-
- /* Since .06 this will implicitly use numeric nicks when needed */
+ ircd_snprintf(0, num, sizeof(num), "%03d", numeric);
if (acptr)
- sendto_prefix_one(acptr, sptr, ":%s %d %s%s",
- sptr->name, numeric, acptr->name, buffer);
+ sendcmdto_one(sptr, num, num, acptr, "%C %s", acptr, parv[2]);
else
- sendto_channel_butone(cptr, sptr, achptr, ":%s %d %s%s",
- sptr->name, numeric, achptr->chname, buffer);
+ sendcmdto_channel_butone(sptr, num, num, achptr, cptr,
+ SKIP_DEAF | SKIP_BURST, "%H %s", achptr, parv[2]);
return 0;
}