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.
[ From commit fad9c75cc6
in ELinks
0.12.GIT. --KON ]
This commit is contained in:
parent
f311f3ea93
commit
0bdbb983b8
@ -466,6 +466,7 @@ accept_cookie(struct cookie *cookie)
|
||||
continue;
|
||||
|
||||
delete_cookie(c);
|
||||
/* @set_cookies_dirty will be called below. */
|
||||
}
|
||||
}
|
||||
|
||||
@ -535,6 +536,7 @@ reject_cookie(void *idp)
|
||||
if (!c) return;
|
||||
|
||||
delete_cookie(c);
|
||||
set_cookies_dirty(); /* @find_cookie_id doesn't use @cookie_queries */
|
||||
}
|
||||
|
||||
|
||||
@ -822,6 +824,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)
|
||||
{
|
||||
@ -842,6 +846,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(
|
||||
|
@ -187,12 +187,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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user