1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

Bug 886: Update cookies_dirty after delete_cookie calls as appropriate.

This commit is contained in:
Kalle Olavi Niemitalo 2006-12-09 16:24:24 +02:00 committed by Kalle Olavi Niemitalo
parent b79210ea1b
commit fad9c75cc6
2 changed files with 10 additions and 5 deletions

View File

@ -504,6 +504,7 @@ accept_cookie(struct cookie *cookie)
continue;
delete_cookie(c);
/* @set_cookies_dirty will be called below. */
}
}
@ -573,6 +574,7 @@ reject_cookie(void *idp)
if (!c) return;
delete_cookie(c);
set_cookies_dirty(); /* @find_cookie_id doesn't use @cookie_queries */
}
@ -860,6 +862,8 @@ init_cookies(struct module *module)
load_cookies();
}
/* Like @delete_cookie, this function does not set @cookies_dirty.
* The caller must do that if appropriate. */
static void
free_cookies_list(struct list_head *list)
{
@ -880,6 +884,11 @@ done_cookies(struct module *module)
free_cookies_list(&cookies);
free_cookies_list(&cookie_queries);
/* If @save_cookies failed above, @cookies_dirty can still be
* nonzero. Now if @resave_cookies_bottom_half were in the
* queue, it could save the empty @cookies list to the file.
* Prevent that. */
cookies_dirty = 0;
}
struct module cookies_module = struct_module(

View File

@ -188,12 +188,8 @@ delete_cookie_item(struct listbox_item *item, int last)
assert(!is_object_used(cookie));
delete_cookie(cookie);
set_cookies_dirty();
}
if (last
&& get_opt_bool("cookies.save")
&& get_opt_bool("cookies.resave"))
save_cookies();
}
static struct listbox_ops_messages cookies_messages = {