From 60a328bc2c2f77ae8814fa2415a37f27ce55430a Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 16 Dec 2022 12:21:23 -0800 Subject: [PATCH] paranoid confirmation prompt yn() and company show the list of possible responses in square brackets and the default response in parentheses: |Do foo? [ynaq] (y) but paranoid_querty() was using the punctuation chars backwards |Do foo? (yes) [n] or |Do foo? (yes|no) depending on the level of paranoid. Change those to be |Do foo? [yes|n] (n) (default gets used for but unlike yn(), not for ) and |Do foo? [yes|no] (with no default for the latter). --- src/cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 950320c52..420be4efb 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 cmd.c $NHDT-Date: 1661240704 2022/08/23 07:45:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.616 $ */ +/* NetHack 3.7 cmd.c $NHDT-Date: 1671222065 2022/12/16 20:21:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.650 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -6558,7 +6558,7 @@ paranoid_query(boolean be_paranoid, const char *prompt) if (be_paranoid) { char pbuf[BUFSZ], qbuf[QBUFSZ], ans[BUFSZ]; const char *promptprefix = "", - *responsetype = ParanoidConfirm ? "(yes|no)" : "(yes) [no]"; + *responsetype = ParanoidConfirm ? "[yes|no]" : "[yes|n] (n)"; int k, trylimit = 6; /* 1 normal, 5 more with "Yes or No:" prefix */ copynchars(pbuf, prompt, BUFSZ - 1); @@ -6585,9 +6585,9 @@ paranoid_query(boolean be_paranoid, const char *prompt) break; promptprefix = "\"Yes\" or \"No\": "; } while (ParanoidConfirm && strcmpi(ans, "no") && --trylimit); - } else + } else { confirmed_ok = (yn(prompt) == 'y'); - + } return confirmed_ok; }