Fix coding style.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2022-02-23 18:29:55 +03:00
parent 4518885f93
commit c83f989a11
3 changed files with 13 additions and 14 deletions

View File

@ -191,9 +191,12 @@ mc_search__run_glob (mc_search_t * lc_mc_search, const void *user_data,
GString *
mc_search_glob_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str)
{
GString *repl = mc_search__translate_replace_glob_to_regex (replace_str->str);
GString *res = mc_search_regex_prepare_replace_str (lc_mc_search, repl);
GString *repl, *res;
repl = mc_search__translate_replace_glob_to_regex (replace_str->str);
res = mc_search_regex_prepare_replace_str (lc_mc_search, repl);
g_string_free (repl, TRUE);
return res;
}

View File

@ -820,7 +820,6 @@ mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_
tmp = mc_search_cond->str;
mc_search_cond->str = mc_search__cond_struct_new_regex_ci_str (charset, tmp);
g_string_free (tmp, TRUE);
}
}
@ -847,16 +846,13 @@ mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_
if (!lc_mc_search->is_case_sensitive)
pcre_options |= PCRE_CASELESS;
}
else
else if (!lc_mc_search->is_case_sensitive)
{
if (!lc_mc_search->is_case_sensitive)
{
GString *tmp;
GString *tmp;
tmp = mc_search_cond->str;
mc_search_cond->str = mc_search__cond_struct_new_regex_ci_str (charset, tmp);
g_string_free (tmp, TRUE);
}
tmp = mc_search_cond->str;
mc_search_cond->str = mc_search__cond_struct_new_regex_ci_str (charset, tmp);
g_string_free (tmp, TRUE);
}
mc_search_cond->regex_handle =

View File

@ -94,17 +94,17 @@ mc_search__cond_struct_new (mc_search_t * lc_mc_search, const char *str,
static void
mc_search__cond_struct_free (mc_search_cond_t * mc_search_cond)
{
if (mc_search_cond->upper)
if (mc_search_cond->upper != NULL)
g_string_free (mc_search_cond->upper, TRUE);
if (mc_search_cond->lower)
if (mc_search_cond->lower != NULL)
g_string_free (mc_search_cond->lower, TRUE);
g_string_free (mc_search_cond->str, TRUE);
g_free (mc_search_cond->charset);
#ifdef SEARCH_TYPE_GLIB
if (mc_search_cond->regex_handle)
if (mc_search_cond->regex_handle != NULL)
g_regex_unref (mc_search_cond->regex_handle);
#else /* SEARCH_TYPE_GLIB */
g_free (mc_search_cond->regex_handle);