From: nethack.rankin Date: Tue, 17 Sep 2002 06:35:49 +0000 (+0000) Subject: fix B12001 - ?--More--single line menu X-Git-Tag: MOVE2GIT~2419 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=651e886d66c8e23439fcb2c554923b62cdd2b07a;p=nethack fix B12001 - ?--More--single line menu From a bug report: 3.4.0 broke the ability to pick the only listed inventory letter when user typed '?' during object selection and one candidate was listed on the top line followed by --More--. What do you want to throw? [b or ?*] ? b - 7 +0 daggers (alternate weapon; not wielded).--More--b (Dismissing --More-- the normal way and getting a new selection prompt worked as usual.) The problem was caused by changes in getobj's count handling; the message_menu() routine isn't able to handle counts but display_pickinv left the count as 0 while caller expects -1 for "count not specified". This was a core bug but I put the fixes entry under "tty" since no other interfaces are affected. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 029608800..840f402c3 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -275,22 +275,23 @@ win32tty: respond only to mouse clicks not mouse movement win32tty: allow ^C to abort the game at the "Who are you?" prompt win32tty: fix truncated score list win32tty: prevent ALT+CTRL from sending NUL to core with the meta bit set -X11: restore support for non-square tiles when USE_XPM is defined Gnome: add support for non-square tiles -tty: remove #define DEBUG that forced debug behavior in production builds -X11: getlin dialog got steadily narrower each time it was used -unix: install recover command into GAMEDIR by default -tty: correctly handle an empty TERM environment variable -tty: don't lose messages when ESC has canceled their display -tty: clear topl after pickup_burden prompt Gnome: destroy main game windows correctly Gnome: Dylan Alex Simon's port of KDE-style worn window Gnome: Dylan Alex Simon's port of KDE-style hero cursor color -tty: support terms where turning off inverse video turns off color too Gnome/Linux: more portable getres*id workaround +X11: restore support for non-square tiles when USE_XPM is defined +X11: getlin dialog got steadily narrower each time it was used msdos: compiling without NO_TERMS resulted in a link-time error msdos: reworked Makefile.GCC to get rid of need to duplicate source files msdos,win32: stop doing chdir when NOCWD_ASSUMPTIONS is defined +tty: remove #define DEBUG that forced debug behavior in production builds +tty: correctly handle an empty TERM environment variable +tty: don't lose messages when ESC has canceled their display +tty: clear topl after pickup_burden prompt +tty: support terms where turning off inverse video turns off color too +tty: object selection at --More-- prompt after '?' didn't work anymore +unix: install recover command into GAMEDIR by default vms: prevent error() from indirectly triggering hangup save during forced exit diff --git a/src/invent.c b/src/invent.c index 2dd0d5713..4350e5758 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)invent.c 3.4 2002/04/07 */ +/* SCCS Id: @(#)invent.c 3.4 2002/09/16 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1677,6 +1677,7 @@ long* out_cnt; ret = message_menu(lets[0], want_reply ? PICK_ONE : PICK_NONE, xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L)); + if (out_cnt) *out_cnt = -1L; /* select all */ break; } }