mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* util.c (list_append_unique): Free removed links.
* utilunix.c (destroy_groups): Use g_tree_foreach() instead of obsolete g_tree_traverse().
This commit is contained in:
parent
cb1438913a
commit
30aeb24388
@ -1,5 +1,9 @@
|
||||
2003-02-18 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* util.c (list_append_unique): Free removed links.
|
||||
* utilunix.c (destroy_groups): Use g_tree_foreach() instead of
|
||||
obsolete g_tree_traverse().
|
||||
|
||||
* util.c (list_append_unique): Traverse the list backwards.
|
||||
Otherwise the list was lost when the current link was removed.
|
||||
|
||||
|
@ -1181,8 +1181,10 @@ list_append_unique (GList *list, char *text)
|
||||
|
||||
while (link) {
|
||||
newlink = g_list_previous (link);
|
||||
if (!strcmp ((char *) link->data, text))
|
||||
if (!strcmp ((char *) link->data, text)) {
|
||||
g_list_remove_link (list, link);
|
||||
g_list_free_1 (link);
|
||||
}
|
||||
link = newlink;
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ get_user_permissions (struct stat *buf) {
|
||||
void
|
||||
destroy_groups (void)
|
||||
{
|
||||
g_tree_traverse (current_user_gid, mc_gid_destroy, G_POST_ORDER, NULL);
|
||||
g_tree_foreach (current_user_gid, mc_gid_destroy, NULL);
|
||||
g_tree_destroy (current_user_gid);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user