Unverified Commit 732d0938 authored by Daniel Gustafsson's avatar Daniel Gustafsson Committed by Daniel Stenberg
Browse files

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
parent 3c630f9b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;