mirror of
https://github.com/curl/curl.git
synced 2026-07-22 20:27:17 +03:00
cookies: ensure that we have cookies before writing jar
The jar should be written iff there are cookies, so ensure that we still have cookies after expiration to avoid creating an empty file. Closes #2529
This commit is contained in:
parent
3c630f9b0a
commit
732d093835
1 changed files with 4 additions and 0 deletions
|
|
@ -1442,6 +1442,10 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
|
|||
/* at first, remove expired cookies */
|
||||
remove_expired(c);
|
||||
|
||||
/* make sure we still have cookies after expiration */
|
||||
if(0 == c->numcookies)
|
||||
return 0;
|
||||
|
||||
if(!strcmp("-", dumphere)) {
|
||||
/* use stdout */
|
||||
out = stdout;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue