From 4bbb5e96dd0a902c520f811e9b4e11ce2c000f01 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Tue, 5 May 2009 08:07:04 +0200 Subject: [PATCH] Cosmetics. --- selector.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/selector.cc b/selector.cc index 6360698..637ae74 100644 --- a/selector.cc +++ b/selector.cc @@ -200,11 +200,11 @@ int match(char *string, matcher_t *matcher) { } void free_matcher(matcher_t *matcher) { - if(matcher->nb_patterns >= 0) { + if(matcher->nb_patterns < 0) { + if(!matcher->regexp_error) regfree(&matcher->preg); + } else { delete[] matcher->splitted_patterns; delete[] matcher->patterns; - } else { - if(!matcher->regexp_error) regfree(&matcher->preg); } } @@ -388,7 +388,7 @@ void update_screen(int *current_line, int *temporary_line, int motion, int first_line = new_line, last_line = new_line, nb_match = 1; // We find the first and last line to show, so that the total of - // visible lines between them (them include) is console_height - 1 + // visible lines between them (them included) is console_height-1 while(nb_match < console_height-1 && (first_line > 0 || last_line < nb_lines - 1)) { @@ -425,8 +425,8 @@ void update_screen(int *current_line, int *temporary_line, int motion, k++; } - // We fill the rest of the line with blanks if either we did - // not clear() or if this is the highlighted line + // We fill the rest of the line with blanks if this is the + // highlighted line if(l == new_line) { while(k < console_width) { -- 2.20.1