From 3ea0cc1483bb10124c1d027fbb06e9c103360251 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 20 Jun 2019 00:53:45 -0700 Subject: [PATCH 1/4] fuzzer tweak tweak Recent fuzzer tweak had an unintended side-effect: NUL character is used to indicate a mouse click and we weren't setting up fake value for one of those. Go back to avoiding NUL when obtaining a random value for user's keystroke. --- src/cmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 2aa2df4db..a3a1e60c5 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1560789049 2019/06/17 16:30:49 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.336 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1561017215 2019/06/20 07:53:35 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.337 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4572,7 +4572,8 @@ randomkey() c = (char) rn1('9' - '0' + 1, '0'); break; case 14: - c = (char) rn2(iflags.wc_eight_bit_input ? 256 : 128); + /* any char, but avoid '\0' because it's used for mouse click */ + c = (char) rnd(iflags.wc_eight_bit_input ? 255 : 127); break; } From 9f6588af49766c00998291ff79735922199c8563 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 20 Jun 2019 01:14:50 -0700 Subject: [PATCH 2/4] curses text windows Most of the entries for '?' looked awful because curses was using ((terminal_width / 2) - 2) for the window width ('- 2' was to make for for a border around the popup window, regardless of what the 'windowborder' option was set to). Splitting text that has been manually formatted for 80 columns "worked" but looked bad when not required. Some of the help files are using 79 characters on a few lines, producing wrapped text when displayed. Those would look better if limited them to 78 or if curses can be modified to suppress the window border when the entire display is being covered by a popup. --- doc/fixes36.3 | 3 ++- win/curses/cursdial.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 23780792c..11ac2c882 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.57 $ $NHDT-Date: 1560855142 2019/06/18 10:52:22 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.58 $ $NHDT-Date: 1561018485 2019/06/20 08:14:45 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -129,6 +129,7 @@ curses: don't convert ^M (or or key) into ^J; both ^J and ^M off) and ^M is not bound to any command, so accidental won't cause the hero to try to move curses: draw map in screen columns 1..79 like tty, rather than in 2..80 +curses: make text windows wider so that help feedback is more readable curses+EDIT_GETLIN: when a prompt's answer was preloaded, using ESC to discard it deleted it from the answer buffer but didn't erase it from screen tty: re-do one optimization used when status conditions have all been removed diff --git a/win/curses/cursdial.c b/win/curses/cursdial.c index 2f2f5fcce..656d3b6a7 100644 --- a/win/curses/cursdial.c +++ b/win/curses/cursdial.c @@ -1025,8 +1025,11 @@ menu_win_size(nhmenu *menu) /* Try not to wrap headers/normal text lines if possible. We can go wider than half the screen for this purpose if need be */ - if ((maxheaderwidth > maxwidth) && (maxheaderwidth < (term_cols - 2))) { - maxwidth = maxheaderwidth; + if (maxheaderwidth > maxwidth) { + if (maxheaderwidth < (term_cols - 2)) + maxwidth = maxheaderwidth; + else + maxwidth = term_cols - 2; } width = maxwidth; From 2a5080e6f9e566d629627da163e1a036d47ce8ab Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 20 Jun 2019 01:24:10 -0700 Subject: [PATCH 3/4] update contact URL Reviewing the help choices revealed an out of date one. --- include/hack.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hack.h b/include/hack.h index 8cb0b7253..0b8a780a4 100644 --- a/include/hack.h +++ b/include/hack.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 hack.h $NHDT-Date: 1559227823 2019/05/30 14:50:23 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.105 $ */ +/* NetHack 3.6 hack.h $NHDT-Date: 1561019041 2019/06/20 08:24:01 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.106 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2017. */ /* NetHack may be freely redistributed. See license for details. */ @@ -531,6 +531,6 @@ enum bodypart_types { #endif #define DEVTEAM_EMAIL "devteam@nethack.org" -#define DEVTEAM_URL "http://www.nethack.org" +#define DEVTEAM_URL "https://www.nethack.org/" #endif /* HACK_H */ From 8bfe6f82f1b26fb02085868ea7809611984b9e7d Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 20 Jun 2019 02:26:48 -0700 Subject: [PATCH 4/4] Re-do the formatting for help on menu control keys and add the non-configurable keys: space, return, and escape. --- doc/fixes36.3 | 3 ++- src/options.c | 57 ++++++++++++++++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 11ac2c882..8ae1adaa5 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.58 $ $NHDT-Date: 1561018485 2019/06/20 08:14:45 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.59 $ $NHDT-Date: 1561022792 2019/06/20 09:26:32 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -76,6 +76,7 @@ if hero knows the number of charges in a wand or magical horn and a monster for wizard mode 'monpolycontrol', allow usually disallowed type 'chameleon', 'doppelganger', or 'sandestin' as answer to "change @ into what?" prompt when is really that type of creature +add Space, Return, and Escape to '? k' (help for menu control keys) Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/options.c b/src/options.c index c92c5ab35..20c82ba4e 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 options.c $NHDT-Date: 1560789054 2019/06/17 16:30:54 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.364 $ */ +/* NetHack 3.6 options.c $NHDT-Date: 1561022792 2019/06/20 09:26:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.365 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4280,36 +4280,55 @@ boolean dolist; putstr(win, 0, buf); } } else { + const char + fmt3[] = " %-12s %-2s %-2s %s", + fmt2[] = " %-12s %-2s %-2s", + fmt1[] = " %10s %-2s %s", + fmt0[] = " %14s %s"; + putstr(win, 0, ""); - putstr(win, 0, " Page All items"); - Sprintf(buf, " Select %s %s", + putstr(win, 0, "Selection: On page Full menu"); + Sprintf(buf, fmt2, "Select all", visctrl(get_menu_cmd_key(MENU_SELECT_PAGE)), visctrl(get_menu_cmd_key(MENU_SELECT_ALL))); putstr(win, 0, buf); - Sprintf(buf, "Deselect %s %s", + Sprintf(buf, fmt2, "Deselect all", visctrl(get_menu_cmd_key(MENU_UNSELECT_PAGE)), visctrl(get_menu_cmd_key(MENU_UNSELECT_ALL))); putstr(win, 0, buf); - Sprintf(buf, " Invert %s %s", + Sprintf(buf, fmt2, "Invert all", visctrl(get_menu_cmd_key(MENU_INVERT_PAGE)), visctrl(get_menu_cmd_key(MENU_INVERT_ALL))); putstr(win, 0, buf); - putstr(win, 0, ""); - Sprintf(buf, " Go to %s Next page", - visctrl(get_menu_cmd_key(MENU_NEXT_PAGE))); - putstr(win, 0, buf); - Sprintf(buf, " %s Previous page", - visctrl(get_menu_cmd_key(MENU_PREVIOUS_PAGE))); - putstr(win, 0, buf); - Sprintf(buf, " %s First page", - visctrl(get_menu_cmd_key(MENU_FIRST_PAGE))); - putstr(win, 0, buf); - Sprintf(buf, " %s Last page", - visctrl(get_menu_cmd_key(MENU_LAST_PAGE))); + Sprintf(buf, fmt3, "Text match", "", + visctrl(get_menu_cmd_key(MENU_SEARCH)), + "Search and toggle matching entries"); putstr(win, 0, buf); putstr(win, 0, ""); - Sprintf(buf, " %s Search and toggle matching entries", - visctrl(get_menu_cmd_key(MENU_SEARCH))); + putstr(win, 0, "Navigation:"); + Sprintf(buf, fmt1, "Go to ", + visctrl(get_menu_cmd_key(MENU_NEXT_PAGE)), + "Next page"); + putstr(win, 0, buf); + Sprintf(buf, fmt1, "", + visctrl(get_menu_cmd_key(MENU_PREVIOUS_PAGE)), + "Previous page"); + putstr(win, 0, buf); + Sprintf(buf, fmt1, "", + visctrl(get_menu_cmd_key(MENU_FIRST_PAGE)), + "First page"); + putstr(win, 0, buf); + Sprintf(buf, fmt1, "", + visctrl(get_menu_cmd_key(MENU_LAST_PAGE)), + "Last page"); + putstr(win, 0, buf); + Sprintf(buf, fmt0, "SPACE", "Next page, if any, otherwise RETURN"); + putstr(win, 0, buf); + Sprintf(buf, fmt0, "RETURN/ENTER", + "Finish menu with any selection(s) made"); + putstr(win, 0, buf); + Sprintf(buf, fmt0, "ESCAPE", + "Cancel menu without selecting anything"); putstr(win, 0, buf); } }