At last, here is the correct cookie patch for WWWOFFLE 2.7d.

-- 
Marc
--- headbody.c  Fri Jul 19 20:15:02 2002
+++ headbody.c  Sun Aug  4 23:11:59 2002
@@ -539,7 +539,9 @@
        'expires=Wdy, DD-Mon-YY HH:MM:SS GMT' and contains an embedded ','!
      */
 
-    if(!strcmp(head->key[i],"Set-Cookie"))
+    /* Doesn't work at all. Modified by Marc Boucher, 01-aug-2002  */
+
+    if(!strcasecmp(head->key[i],"Set-Cookie")) // header also found spelled as 
+"Set-cookie", using strcasecmp instead.
       {
        char **list=split_header_list(head->val[i]),**l;
        int nlist=0;
@@ -559,7 +561,11 @@
           strcpy(p,": ");         p+=2;
           while(*lp && *lp!=',')
              *p++=*lp++;
-          if(**(l+1) && lp>(*l+10) && strncasecmp(p-10,"expires=",8))
+
+          // strcasecmp is not for string lookup. Use strstr instead
+          // going back 10 chars isn't enough, 20 is OK (size of "expire" + day of 
+week).
+          *p=0; // end the string. will stop strstr at this offset.
+          if(**(l+1) && lp>(*l+10) && strstr(p-20,"expires="))
             {
              *p++=',';
              *p++=' ';

Reply via email to