mirror of
https://github.com/moparisthebest/curl
synced 2024-11-04 08:35:05 -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 */
|
/* at first, remove expired cookies */
|
||||||
remove_expired(c);
|
remove_expired(c);
|
||||||
|
|
||||||
|
/* make sure we still have cookies after expiration */
|
||||||
|
if(0 == c->numcookies)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if(!strcmp("-", dumphere)) {
|
if(!strcmp("-", dumphere)) {
|
||||||
/* use stdout */
|
/* use stdout */
|
||||||
out = stdout;
|
out = stdout;
|
||||||
|
Loading…
Reference in New Issue
Block a user