]> sjero.net Git - wget/blobdiff - src/cookies.c
Maintain the cookie value quoted if it was in the server response.
[wget] / src / cookies.c
index 2e41688632d77455af8abd18990aacbfe1826c89..7c3fb1cbab9708b7a20e45b449edf7528fc28983 100644 (file)
@@ -350,6 +350,13 @@ parse_set_cookie (const char *set_cookie, bool silent)
     goto error;
   if (!value.b)
     goto error;
+
+  /* If the value is quoted, do not modify it.  */
+  if (*(value.b - 1) == '"')
+    value.b--;
+  if (*value.e == '"')
+    value.e++;
+
   cookie->attr = strdupdelim (name.b, name.e);
   cookie->value = strdupdelim (value.b, value.e);