From 354664eef28d8bc98b9cdcd2932033849bd385e9 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 26 Oct 2011 20:00:00 +0200 Subject: [PATCH] Make play show no last command when there hasn't been one Before, it printed NULL, which isn't helpful. --- src/lib/commands/play.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/lib/commands/play.c b/src/lib/commands/play.c index a0a79a29a..c28336898 100644 --- a/src/lib/commands/play.c +++ b/src/lib/commands/play.c @@ -29,6 +29,7 @@ * Known contributors to this file: * Ken Stevens, 1995 * Steve McClure, 1998 + * Markus Armbruster, 2005-2011 */ #include @@ -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"); -- 2.43.0