summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-09-25 22:14:42 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-09-25 22:14:42 +0000
commit28ad7dc4a1e78d55a17fe4c0b20823791ce74caa (patch)
treed5ba634d352b348dc070a4fcb2d4fe4966e43c6f
parente40f0be7e318472f16ea7abfee734d675a40047a (diff)
downloadgnurl-28ad7dc4a1e78d55a17fe4c0b20823791ce74caa.tar.gz
gnurl-28ad7dc4a1e78d55a17fe4c0b20823791ce74caa.tar.bz2
gnurl-28ad7dc4a1e78d55a17fe4c0b20823791ce74caa.zip
a single cookie does not require a trailing semicolon anymore
-rw-r--r--lib/cookie.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/cookie.c b/lib/cookie.c
index e21e88b40..01c3f2d2f 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -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