]> git.pond.sub.org Git - empserver/commitdiff
(flash, wall): Use player->comtail[] to find the raw message. The old
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 25 Nov 2007 14:31:09 +0000 (14:31 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 25 Nov 2007 14:31:09 +0000 (14:31 +0000)
hack to find worked only when there were no spaces in flash's first
argument.  Closes #941740.

src/lib/commands/flash.c

index 9473bd034ad07da1dfeb19c3bf05e17e9c11788d..e8923aa613b70fbce6c308b4a97dc22dd3ac4264 100644 (file)
@@ -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);