Commit f1b5be4b authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: elide an unneeded variable

No related merge requests found
Showing with 4 additions and 6 deletions
+4 -6
......@@ -96,10 +96,10 @@ void search_init(bool replacing, bool keep_the_answer)
{
char *thedefault;
/* What will be searched for when the user typed nothing. */
static char *sofar = NULL;
/* What the user has typed so far, before toggling something. */
sofar = mallocstrcpy(sofar, keep_the_answer ? answer : "");
/* When starting a new search, clear the current answer. */
if (!keep_the_answer)
answer = mallocstrcpy(answer, NULL);
/* If something was searched for earlier, include it in the prompt. */
if (*last_search != '\0') {
......@@ -118,7 +118,7 @@ void search_init(bool replacing, bool keep_the_answer)
/* Ask the user what to search for (or replace). */
int i = do_prompt(FALSE, FALSE,
inhelp ? MFINDINHELP : (replacing ? MREPLACE : MWHEREIS),
sofar, &search_history,
answer, &search_history,
/* TRANSLATORS: This is the main search prompt. */
edit_refresh, "%s%s%s%s%s%s", _("Search"),
/* TRANSLATORS: The next three modify the search prompt. */
......@@ -168,8 +168,6 @@ void search_init(bool replacing, bool keep_the_answer)
return;
}
sofar = mallocstrcpy(sofar, answer);
func = func_from_key(&i);
/* If we're here, one of the five toggles was pressed, or
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment