Ticket #4395: searchnewline.diff

File searchnewline.diff, 1.2 KB (added by sxmboer2, 2 years ago)
  • lib/search/regex.c

    diff --git a/lib/search/regex.c b/lib/search/regex.c
    index 32be35319..5443ec39b 100644
    a b mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data, 
    902902        { 
    903903            while (TRUE) 
    904904            { 
    905                 int current_chr = '\n'; /* stop search symbol */ 
     905                int current_chr = '\0'; /* stop search symbol */ 
    906906 
    907907                ret = lc_mc_search->search_fn (user_data, current_pos, &current_chr); 
    908908 
    mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data, 
    921921 
    922922                g_string_append_c (lc_mc_search->regex_buffer, (char) current_chr); 
    923923 
    924                 if ((char) current_chr == '\n' || virtual_pos > end_search) 
     924                if ((char) current_chr == '\0' || virtual_pos >= end_search) 
    925925                    break; 
    926926            } 
    927927        } 
    mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data, 
    940940 
    941941                current_pos++; 
    942942 
    943                 if (current_chr == '\n' || current_pos > end_search) 
     943                if (current_pos >= end_search) 
    944944                    break; 
    945945            } 
    946946