diff --git a/src/cmd.c b/src/cmd.c index 8273cfade..84fac12f5 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -5307,15 +5307,28 @@ yn_function( } #endif /* should not happen but cq.key has been observed to not obey 'resp'; - do this after dumplog has recorded the potentially bad value */ + it is most likely caused by saving a keystroke that was just used + to answer a context-sensitive prompt, then using the do-again + command with context that has changed */ if (resp && res && !strchr(resp, res)) { /* this probably needs refinement since caller is expecting something within 'resp' and ESC won't be (it could be present, but as a flag for unshown possibilities rather than as acceptable input) */ int altres = def ? def : '\033'; - impossible("yn_function() returned '%s'; using '%s' instead", - visctrl(res), visctrl(altres)); + if (!gi.in_doagain || wizard) { +/*TEMP*/ xint8 fuzzing = iflags.debug_fuzzer; + char dbg_buf[BUFSZ]; + + Snprintf(dbg_buf, sizeof dbg_buf, "%s [%s] (%s)", + query, resp ? resp : "", def ? visctrl(def) : ""); + paniclog("yn debug", dbg_buf); +/*TEMP*/ /* don't let this known problem kill the fuzzer */ +/*TEMP*/ iflags.debug_fuzzer = fuzzer_impossible_continue; + impossible("yn_function() returned '%s'; using '%s' instead", + visctrl(res), visctrl(altres)); +/*TEMP*/ iflags.debug_fuzzer = fuzzing; + } res = altres; } /* in case we're called via getdir() which sets input_state */