From 566223c36bdb706e459669f277a5e457a492937d Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 25 Nov 2007 14:31:09 +0000 Subject: [PATCH] (flash, wall): Use player->comtail[] to find the raw message. The old hack to find worked only when there were no spaces in flash's first argument. Closes #941740. --- src/lib/commands/flash.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/lib/commands/flash.c b/src/lib/commands/flash.c index 9473bd03..e8923aa6 100644 --- a/src/lib/commands/flash.c +++ b/src/lib/commands/flash.c @@ -47,7 +47,6 @@ flash(void) struct natstr *to; char buf[1024]; /* UTF-8 */ int tocn; - char *sp; /* points into player->combuf[], UTF-8 */ us = getnatp(player->cnum); if ((tocn = natarg(player->argp[1], "to which country? ")) < 0) @@ -70,11 +69,10 @@ flash(void) } } - if (player->argp[2]) { - for (sp = player->combuf; *sp && *sp != ' '; ++sp) ; - for (++sp; *sp && *sp != ' '; ++sp) ; + if (player->comtail[2]) { buf[0] = ':'; - strcpy(buf+1, sp); + buf[1] = ' '; + strcpy(buf+2, player->comtail[2]); sendmessage(us, to, buf, 1); } else { sendmessage(us, to, "...", 1); @@ -93,13 +91,12 @@ wall(void) { struct natstr *us; char buf[1024]; /* UTF-8 */ - char *sp; /* points into player->combuf[], UTF-8 */ us = getnatp(player->cnum); - if (player->argp[1]) { - for (sp = player->combuf; *sp && *sp != ' '; ++sp) ; + if (player->comtail[1]) { buf[0] = ':'; - strcpy(buf+1, sp); + buf[1] = ' '; + strcpy(buf+2, player->comtail[1]); sendmessage(us, 0, buf, 1); } else { sendmessage(us, 0, "...", 1);