mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-19 23:04:32 +03:00
search: avoid crashing after searching a help text during a regex replace
Searching in a help text does not support using regular expressions, so when 'inhelp' is set, do not free a compiled regex -- because if there is such a regex, it belongs to a replacement session that is about to begin. This fixes https://savannah.gnu.org/bugs/?65369. The issue was reported by `correctmost`. Bug existed since version 2.8.2, since searching in a help text became possible.
This commit is contained in:
parent
db72774458
commit
ee1a1306e2
@ -57,6 +57,10 @@ 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user