mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 17:29:28 +03:00
(str_replace_all): use g_ptr_array_new_with_free_func().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
a309e1e133
commit
452074906a
@ -77,7 +77,7 @@ str_replace_all (const char *haystack, const char *needle, const char *replaceme
|
|||||||
|
|
||||||
needle_len = strlen (needle);
|
needle_len = strlen (needle);
|
||||||
|
|
||||||
str_splints = g_ptr_array_new ();
|
str_splints = g_ptr_array_new_with_free_func (g_free);
|
||||||
|
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
@ -109,7 +109,6 @@ str_replace_all (const char *haystack, const char *needle, const char *replaceme
|
|||||||
}
|
}
|
||||||
return_str = str_ptr_array_join (str_splints);
|
return_str = str_ptr_array_join (str_splints);
|
||||||
|
|
||||||
g_ptr_array_foreach (str_splints, (GFunc) g_free, NULL);
|
|
||||||
g_ptr_array_free (str_splints, TRUE);
|
g_ptr_array_free (str_splints, TRUE);
|
||||||
|
|
||||||
return g_string_free (return_str, FALSE);
|
return g_string_free (return_str, FALSE);
|
||||||
|
Loading…
Reference in New Issue
Block a user