1
1

tweaks: elide a function that is called just once

Also adjust and correct a comment.
Этот коммит содержится в:
Benno Schulenberg 2018-04-13 10:17:08 +02:00
родитель bb394990cd
Коммит c8b26baee8

Просмотреть файл

@ -55,16 +55,6 @@ bool regexp_init(const char *regexp)
return TRUE; return TRUE;
} }
/* Decompile the compiled regular expression we used in the last
* search, if any. */
void regexp_cleanup(void)
{
if (regexp_compiled) {
regexp_compiled = FALSE;
regfree(&search_regexp);
}
}
/* Report on the status bar that the given string was not found. */ /* Report on the status bar that the given string was not found. */
void not_found_msg(const char *str) void not_found_msg(const char *str)
{ {
@ -76,17 +66,18 @@ void not_found_msg(const char *str)
free(disp); free(disp);
} }
/* Abort the current search or replace. Clean up by displaying the main /* Free a compiled regular expression, if one was compiled; and schedule a
* shortcut list, updating the screen if the mark was on before, and * full screen refresh when the mark is on, in case the cursor has moved. */
* decompiling the compiled regular expression we used in the last
* search, if any. */
void search_replace_abort(void) void search_replace_abort(void)
{ {
if (regexp_compiled) {
regexp_compiled = FALSE;
regfree(&search_regexp);
}
#ifndef NANO_TINY #ifndef NANO_TINY
if (openfile->mark) if (openfile->mark)
refresh_needed = TRUE; refresh_needed = TRUE;
#endif #endif
regexp_cleanup();
} }
/* Prepare the prompt and ask the user what to search for. Keep looping /* Prepare the prompt and ask the user what to search for. Keep looping