a single cookie does not require a trailing semicolon anymore

This commit is contained in:
Daniel Stenberg 2000-09-25 22:14:42 +00:00
parent e40f0be7e3
commit 28ad7dc4a1
1 changed files with 7 additions and 3 deletions

View File

@ -99,8 +99,9 @@ struct Cookie *cookie_add(struct CookieInfo *c,
semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
ptr = lineptr;
while(semiptr) {
*semiptr='\0'; /* zero terminate for a while */
do {
if(semiptr)
*semiptr='\0'; /* zero terminate for a while */
/* we have a <what>=<this> pair or a 'secure' word here */
if(strchr(ptr, '=')) {
name[0]=what[0]=0; /* init the buffers */
@ -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