diff --git a/lib/search/normal.c b/lib/search/normal.c index 4287e2174..49e45675e 100644 --- a/lib/search/normal.c +++ b/lib/search/normal.c @@ -94,9 +94,10 @@ mc_search__cond_struct_new_init_normal (const char *charset, mc_search_t * lc_mc if (lc_mc_search->whole_words) { /* NOTE: \b as word boundary doesn't allow search - * whole words with non-ASCII symbols */ - g_string_prepend (tmp, "(^|[^\\p{L}\\p{N}_])("); - g_string_append (tmp, ")([^\\p{L}\\p{N}_]|$)"); + * whole words with non-ASCII symbols. + * Update: Is it still true nowadays? Probably not. #2396, #3524 */ + g_string_prepend (tmp, "(?str = tmp; diff --git a/lib/search/regex.c b/lib/search/regex.c index 082fa2c0f..ac24c8de8 100644 --- a/lib/search/regex.c +++ b/lib/search/regex.c @@ -881,21 +881,10 @@ mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data, { case COND__FOUND_OK: #ifdef SEARCH_TYPE_GLIB - if (lc_mc_search->whole_words) - g_match_info_fetch_pos (lc_mc_search->regex_match_info, 2, &start_pos, &end_pos); - else - g_match_info_fetch_pos (lc_mc_search->regex_match_info, 0, &start_pos, &end_pos); + g_match_info_fetch_pos (lc_mc_search->regex_match_info, 0, &start_pos, &end_pos); #else /* SEARCH_TYPE_GLIB */ - if (lc_mc_search->whole_words) - { - start_pos = lc_mc_search->iovector[4]; - end_pos = lc_mc_search->iovector[5]; - } - else - { - start_pos = lc_mc_search->iovector[0]; - end_pos = lc_mc_search->iovector[1]; - } + start_pos = lc_mc_search->iovector[0]; + end_pos = lc_mc_search->iovector[1]; #endif /* SEARCH_TYPE_GLIB */ if (found_len != NULL) *found_len = end_pos - start_pos;