--- deliantra/server/socket/request.C 2007/07/02 02:29:34 1.113 +++ deliantra/server/socket/request.C 2007/07/10 06:05:55 1.114 @@ -203,29 +203,17 @@ * that information. */ void -RequestInfo (char *buf, int len, client * ns) +RequestInfo (char *buf, int len, client *ns) { - char *params = NULL, *cp; - - /* No match */ - char bigbuf[MAX_BUF]; - int slen; - - /* Set up replyinfo before we modify any of the buffers - this is used - * if we don't find a match. - */ - strcpy (bigbuf, "replyinfo "); - slen = strlen (bigbuf); - safe_strcat (bigbuf, buf, &slen, MAX_BUF); + char *params; /* find the first space, make it null, and update the * params pointer. */ - for (cp = buf; *cp != '\0'; cp++) - if (*cp == ' ') + for (params = buf; *params; params++) + if (*params == ' ') { - *cp = '\0'; - params = cp + 1; + *params++ = 0; break; } @@ -238,7 +226,13 @@ else if (!strcmp (buf, "spell_paths")) send_spell_paths (ns, params); else - ns->send_packet (bigbuf, len); + { + // undo tokenisation above and send replyinfo with the request unchanged + if (*params) + *--params = ' '; + + ns->send_packet_printf ("replyinfo %s", buf); + } } void