]> sjero.net Git - wget/commitdiff
[svn] More old fixes.
authorhniksic <devnull@localhost>
Fri, 31 Mar 2000 14:14:58 +0000 (06:14 -0800)
committerhniksic <devnull@localhost>
Fri, 31 Mar 2000 14:14:58 +0000 (06:14 -0800)
src/ChangeLog
src/html.c
src/http.c

index 20e6c09882c4e656046d775c602cf2dc72281711..14e580d0f249c4639d59d22341a951f803406c72 100644 (file)
@@ -1,3 +1,12 @@
+1998-10-17  Hrvoje Niksic  <hniksic@srce.hr>
+
+       * http.c (http_process_type): Removed needless strdup(), a memory
+       leak.
+
+1998-09-25  Hrvoje Niksic  <hniksic@srce.hr>
+
+       * html.c (htmlfindurl): Set PH to the first occurrence of `#'.
+
 1998-09-25  Simon Munton  <simonm@m4data.co.uk>
 
        * init.c (wgetrc_file_name): Don't free HOME under Windows.
index 51a8233ee12a3316f25996f8719d62d3682afeeb..c8767d6e6351bf36d5f9091c1b11640435509aae 100644 (file)
@@ -264,7 +264,7 @@ htmlfindurl (const char *buf, int bufsize, int *size, int init)
              for (++buf, --bufsize;
                   bufsize && *buf != s->quote_char && *buf != '\n';
                   ++buf, --bufsize)
-               if (*buf == '#')
+               if (ph && *buf == '#')
                  ph = buf;
              if (!bufsize)
                {
@@ -287,7 +287,7 @@ htmlfindurl (const char *buf, int bufsize, int *size, int init)
            {
              p = buf;
              for (; bufsize && !ISSPACE (*buf) && *buf != '>'; ++buf, --bufsize)
-               if (*buf == '#')
+               if (ph && *buf == '#')
                  ph = buf;
              if (!bufsize)
                break;
index aaaeb580019f2276446b2b3899ee9aa7b7844925..effd0c97298140e68b9f5f656948368d0ff64347 100644 (file)
@@ -241,7 +241,6 @@ http_process_type (const char *hdr, void *arg)
   char **result = (char **)arg;
   char *p;
 
-  *result = xstrdup (hdr);
   p = strrchr (hdr, ';');
   if (p)
     {
@@ -458,13 +457,16 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt)
   remhost = ou->host;
   remport = ou->port;
 
-  if (remport == 80) {
-      host_port = NULL; host_port_len = 0;
-  }
-  else {
+  if (remport == 80)
+    {
+      host_port = NULL;
+      host_port_len = 0;
+    }
+  else
+    {
       host_port = (char *)alloca (numdigit (remport) + 2);
       host_port_len = sprintf (host_port, ":%d", remport);
-  }
+    }
 
   /* Allocate the memory for the request.  */
   request = (char *)alloca (strlen (command) + strlen (path)