]> granicus.if.org Git - nethack/commitdiff
potential infinite loop on hangup (ring prompt)
authorPatR <rankin@nethack.org>
Tue, 1 Sep 2020 11:11:01 +0000 (04:11 -0700)
committerPatR <rankin@nethack.org>
Tue, 1 Sep 2020 11:11:01 +0000 (04:11 -0700)
Core issue noticed while working on some Qt stuff.  If hangup
occurred while prompting for "right or left?" ring finger, the
hangup yn_function() would return ESC and the accessory-on routine
would not see '\0', 'r', or 'l' so reprompt.  Endlessly.

doc/fixes37.0
src/do_wear.c

index b28eb8afcd7c1007b2382183d726e50cc8ca839f..00442d95151732879f55d012c8891ce017eb9990 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.294 $ $NHDT-Date: 1598859031 2020/08/31 07:30:31 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.295 $ $NHDT-Date: 1598958650 2020/09/01 11:10:50 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -248,6 +248,7 @@ end of game inventory disclosure passed an inappropriate argument to the
        inventory display routine; not noticeable for tty and curses,
        noticeable but not harmful for X11, and slightly harmful for Qt
 turning into slime rendered hero as slime one turn too soon
+avoid potential infinite loop if hangup occurs at ring "right or left?" prompt
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index f3a157c81050ef71c1a7ca390f8d0bd5cea37ad3..3d20fe61f55829ecc3c0a3e6d7e25f6a11886cfd 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 do_wear.c       $NHDT-Date: 1596498163 2020/08/03 23:42:43 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.134 $ */
+/* NetHack 3.7 do_wear.c       $NHDT-Date: 1598958650 2020/09/01 11:10:50 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.135 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2012. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1982,6 +1982,7 @@ struct obj *obj;
                     answer = yn_function(qbuf, "rl", '\0');
                     switch (answer) {
                     case '\0':
+                    case '\033':
                         return 0;
                     case 'l':
                     case 'L':