properly skip white spaces on Set-Cookie: header lines
authorDaniel Stenberg <daniel@haxx.se>
Mon, 29 Jul 2002 22:22:49 +0000 (22:22 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 29 Jul 2002 22:22:49 +0000 (22:22 +0000)
lib/cookie.c

index e7628a9..8142541 100644 (file)
@@ -121,7 +121,7 @@ free_cookiemess(struct Cookie *co)
 struct Cookie *
 Curl_cookie_add(struct CookieInfo *c,
                 bool httpheader, /* TRUE if HTTP header-style line */
-                char *lineptr,   /* first non-space of the line */
+                char *lineptr,   /* first character of the line */
                 char *domain)    /* default domain */
 {
   struct Cookie *clist;
@@ -146,6 +146,10 @@ Curl_cookie_add(struct CookieInfo *c,
     /* This line was read off a HTTP-header */
     char *sep;
     semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
+
+    while(*lineptr && isspace((int)*lineptr))
+      lineptr++;
+
     ptr = lineptr;
     do {
       /* we have a <what>=<this> pair or a 'secure' word here */