Index: cookie.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/cookie.c,v
retrieving revision 1.20
diff -u -r1.20 cookie.c
--- cookie.c	2001/09/10 07:43:08	1.20
+++ cookie.c	2001/09/26 07:06:39
@@ -104,7 +104,8 @@
 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 non-space of the line */
+                char *domain)    /* default domain */
 {
   struct Cookie *clist;
   char what[MAX_COOKIE_LINE];
@@ -194,6 +195,10 @@
         ptr++;
       semiptr=strchr(ptr, ';'); /* now, find the next semicolon */
     } while(semiptr);
+
+    if(NULL == co->domain)
+      /* no domain given in the header line, set the default now */
+      co->domain=strdup(domain);
   }
   else {
     /* This line is NOT a HTTP header style line, we do offer support for
@@ -441,7 +446,7 @@
       while(*lineptr && isspace((int)*lineptr))
         lineptr++;
 
-      Curl_cookie_add(c, headerline, lineptr);
+      Curl_cookie_add(c, headerline, lineptr, NULL);
     }
     if(fromfile)
       fclose(fp);
@@ -632,13 +637,13 @@
               "%u\t" /* expires */
               "%s\t" /* name */
               "%s\n", /* value */
-              co->domain,
+              co->domain?co->domain:"unknown",
               co->field1==2?"TRUE":"FALSE",
-              co->path,
+              co->path?co->path:"/",
               co->secure?"TRUE":"FALSE",
               (unsigned int)co->expires,
               co->name,
-              co->value);
+              co->value?co->value:"");
 
       co=co->next;
     }
Index: cookie.h
===================================================================
RCS file: /cvsroot/curl/curl/lib/cookie.h,v
retrieving revision 1.6
diff -u -r1.6 cookie.h
--- cookie.h	2001/08/29 09:32:18	1.6
+++ cookie.h	2001/09/26 07:06:39
@@ -68,7 +68,13 @@
 #define MAX_NAME 256
 #define MAX_NAME_TXT "255"
 
-struct Cookie *Curl_cookie_add(struct CookieInfo *, bool, char *);
+/*
+ * Add a cookie to the internal list of cookies. The domain argument is only
+ * used if the header boolean is TRUE.
+ */
+struct Cookie *Curl_cookie_add(struct CookieInfo *, bool header, char *line,
+                               char *domain);
+
 struct CookieInfo *Curl_cookie_init(char *, struct CookieInfo *);
 struct Cookie *Curl_cookie_getlist(struct CookieInfo *, char *, char *, bool);
 void Curl_cookie_freelist(struct Cookie *);
Index: transfer.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/transfer.c,v
retrieving revision 1.55
diff -u -r1.55 transfer.c
--- transfer.c	2001/09/12 12:02:12	1.55
+++ transfer.c	2001/09/26 07:06:39
@@ -620,7 +620,7 @@
               }
               else if(data->cookies &&
                       strnequal("Set-Cookie:", p, 11)) {
-                Curl_cookie_add(data->cookies, TRUE, &p[12]);
+                Curl_cookie_add(data->cookies, TRUE, &p[12], conn->name);
               }
               else if(strnequal("Last-Modified:", p,
                                 strlen("Last-Modified:")) &&
