Commit 28ad7dc4 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

a single cookie does not require a trailing semicolon anymore

parent e40f0be7
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -99,7 +99,8 @@ struct Cookie *cookie_add(struct CookieInfo *c,

    semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
    ptr = lineptr;
    while(semiptr) {
    do {
      if(semiptr)
        *semiptr='\0'; /* zero terminate for a while */
      /* we have a <what>=<this> pair or a 'secure' word here */
      if(strchr(ptr, '=')) {
@@ -156,12 +157,15 @@ struct Cookie *cookie_add(struct CookieInfo *c,
            ; /* unsupported keyword without assign! */
        }
      }
      if(!semiptr)
        continue; /* we already know there are no more cookies */

      *semiptr=';'; /* put the semicolon back */
      ptr=semiptr+1;
      while(ptr && *ptr && isspace((int)*ptr))
        ptr++;
      semiptr=strchr(ptr, ';'); /* now, find the next semicolon */
    }
    } while(semiptr);
  }
  else {
    /* This line is NOT a HTTP header style line, we do offer support for