Fixed memory leak in mc_search__cond_struct_new_regex_accum_append().
Minor optimization. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
cc26fd2bec
Коммит
e94c1393e6
@ -144,31 +144,32 @@ mc_search__cond_struct_new_regex_accum_append (const char *charset, GString * st
|
|||||||
GString * str_from)
|
GString * str_from)
|
||||||
{
|
{
|
||||||
GString *recoded_part;
|
GString *recoded_part;
|
||||||
gchar *one_char;
|
gsize loop = 0;
|
||||||
gsize loop;
|
|
||||||
gboolean just_letters;
|
|
||||||
|
|
||||||
loop = 0;
|
recoded_part = g_string_sized_new (32);
|
||||||
recoded_part = g_string_new ("");
|
|
||||||
|
|
||||||
while (loop < str_from->len) {
|
while (loop < str_from->len) {
|
||||||
|
gchar *one_char;
|
||||||
|
gsize one_char_len;
|
||||||
|
gboolean just_letters;
|
||||||
|
|
||||||
one_char =
|
one_char =
|
||||||
mc_search__get_one_symbol (charset, &(str_from->str[loop]),
|
mc_search__get_one_symbol (charset, &(str_from->str[loop]),
|
||||||
(str_from->len - loop > 6) ? 6 : str_from->len - loop,
|
min (str_from->len - loop, 6), &just_letters);
|
||||||
&just_letters);
|
one_char_len = strlen (one_char);
|
||||||
if (!strlen (one_char)) {
|
|
||||||
|
if (one_char_len == 0)
|
||||||
loop++;
|
loop++;
|
||||||
continue;
|
else {
|
||||||
}
|
loop += one_char_len;
|
||||||
if (just_letters) {
|
|
||||||
|
if (just_letters)
|
||||||
mc_search__cond_struct_new_regex_hex_add (charset, recoded_part, one_char,
|
mc_search__cond_struct_new_regex_hex_add (charset, recoded_part, one_char,
|
||||||
strlen (one_char));
|
one_char_len);
|
||||||
} else {
|
else
|
||||||
g_string_append (recoded_part, one_char);
|
g_string_append_len (recoded_part, one_char, one_char_len);
|
||||||
}
|
}
|
||||||
loop += strlen (one_char);
|
|
||||||
if (!strlen (one_char))
|
|
||||||
loop++;
|
|
||||||
g_free (one_char);
|
g_free (one_char);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user