Make play show no last command when there hasn't been one
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 26 Oct 2011 18:00:00 +0000 (20:00 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 29 Dec 2011 10:47:04 +0000 (11:47 +0100)
Before, it printed NULL, which isn't helpful.

src/lib/commands/play.c

index a0a79a29a9d621afcc8f74c16dc40fc65de27b33..c28336898addbb413e3b266550ef258fa27f7b16 100644 (file)
@@ -29,6 +29,7 @@
  *  Known contributors to this file:
  *     Ken Stevens, 1995
  *     Steve McClure, 1998
+ *     Markus Armbruster, 2005-2011
  */
 
 #include <config.h>
@@ -105,17 +106,13 @@ play_list(struct player *joe)
        (long)(now - joe->curup));
 
     if (player->god) {
-       if (!joe->combuf || !*joe->combuf)
-           pr(" NULL\n");
-       else {
-           n = ufindpfx(joe->combuf, 20);
-           if (CANT_HAPPEN(n + 3u > sizeof(com))) {
-               pr(" BUGGY\n");
-               return 1;
-           }
-           sprintf(com, " %.*s\n", n, joe->combuf);
-           uprnf(com);
+       n = ufindpfx(joe->combuf, 20);
+       if (CANT_HAPPEN(n + 3u > sizeof(com))) {
+           pr(" BUGGY\n");
+           return 1;
        }
+       sprintf(com, " %.*s\n", n, joe->combuf);
+       uprnf(com);
     } else
        pr("\n");