From 1ca2911b846eb56888114600edcdd00a9510bf05 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 8 Oct 2021 12:36:32 +0200 Subject: [PATCH] prompt: keep a clear answer clear also after an excursion into history When the answer at the prompt was clear before the user went up into the history list, the answer should be cleared again when the user comes back down to the present. This fixes https://savannah.gnu.org/bugs/?61308. Bug existed since before version 2.2.0. --- src/prompt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prompt.c b/src/prompt.c index a198b19f..9e762070 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -507,7 +507,7 @@ functionptrtype acquire_an_answer(int *actual, bool *listed, if (history_list != NULL) { /* If we're scrolling up at the bottom of the history list * and answer isn't blank, save answer in magichistory. */ - if ((*history_list)->next == NULL && *answer != '\0') + if ((*history_list)->next == NULL) magichistory = mallocstrcpy(magichistory, answer); /* Get the older search from the history list and save it in