mirror of
https://github.com/moparisthebest/curl
synced 2024-11-04 16:45:06 -05: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
@ -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…
Reference in New Issue
Block a user