Search engine: if found_len parameter NULL, then mc_search_run don't try to fill them

This commit is contained in:
Slava Zanko 2009-05-06 16:32:13 +03:00
parent 824d12661b
commit 0d76e9aa34
2 changed files with 4 additions and 2 deletions

View File

@ -119,7 +119,8 @@ mc_search__run_normal (mc_search_t * mc_search, const void *user_data,
case COND__FOUND_CHAR_LAST:
mc_search->normal_offset = current_pos;
*found_len = search_pos + 1;
if (found_len)
*found_len = search_pos + 1;
return TRUE;
break;

View File

@ -453,7 +453,8 @@ mc_search__run_regex (mc_search_t * mc_search, const void *user_data,
end_pos = mc_search->regex_match_info[0].rm_eo;
#endif /* HAVE_LIBPCRE */
#endif /* GLIB_CHECK_VERSION (2, 14, 0) */
*found_len = end_pos - start_pos;
if (found_len)
*found_len = end_pos - start_pos;
mc_search->normal_offset = start_buffer + start_pos;
return TRUE;
break;