diff --git a/src/search.c b/src/search.c index aea37e4d..ba18424d 100644 --- a/src/search.c +++ b/src/search.c @@ -57,10 +57,6 @@ bool regexp_init(const char *regexp) * full screen refresh when the mark is on, in case the cursor has moved. */ void tidy_up_after_search(void) { - /* Searching in a help text does not support regular expressions. */ - if (inhelp) - return; - if (have_compiled_regexp) { regfree(&search_regexp); have_compiled_regexp = FALSE; @@ -166,7 +162,9 @@ void search_init(bool replacing, bool retain_answer) break; } - tidy_up_after_search(); + if (!inhelp) + tidy_up_after_search(); + free(thedefault); } @@ -385,7 +383,8 @@ void do_research(void) go_looking(); - tidy_up_after_search(); + if (!inhelp) + tidy_up_after_search(); } /* Search in the backward direction for the next occurrence. */