]> sjero.net Git - wget/blobdiff - src/html-url.c
[svn] Don't crash on <meta http-equiv=refresh>.
[wget] / src / html-url.c
index 73425c05913b8ebd4c2ee372ff9cdef8dcf3aaca..fdafe0f1c46d19caf92f136f38f40da80fd87825 100644 (file)
@@ -120,7 +120,7 @@ static struct {
   { TAG_AREA,          "href",         TUA_EXTERNAL },
   { TAG_BGSOUND,       "src",          0 },
   { TAG_BODY,          "background",   0 },
-  { TAG_EMBED,         "href",         0 },
+  { TAG_EMBED,         "href",         TUA_EXTERNAL },
   { TAG_EMBED,         "src",          0 },
   { TAG_FIG,           "src",          0 },
   { TAG_FRAME,         "src",          0 },
@@ -484,12 +484,18 @@ tag_handle_link (int tagid, struct taginfo *tag, struct map_context *ctx)
   int attrind;
   char *href = find_attr (tag, "href", &attrind);
 
-  /* All <link href="..."> link references are external,
-     except for <link rel="stylesheet" href="...">.  */
+  /* All <link href="..."> link references are external, except those
+     known not to be, such as style sheet and shortcut icon:
+
+       <link rel="stylesheet" href="...">
+       <link rel="shortcut icon" href="...">
+  */
   if (href)
     {
       char *rel  = find_attr (tag, "rel", NULL);
-      int inlinep = (rel && 0 == strcasecmp (rel, "stylesheet"));
+      int inlinep = (rel
+                    && (0 == strcasecmp (rel, "stylesheet")
+                        || 0 == strcasecmp (rel, "shortcut icon")));
       append_one_url (href, inlinep, tag, attrind, ctx);
     }
 }
@@ -515,10 +521,13 @@ tag_handle_meta (int tagid, struct taginfo *tag, struct map_context *ctx)
         get to the URL.  */
 
       struct urlpos *entry;
-
       int attrind;
-      char *p, *refresh = find_attr (tag, "content", &attrind);
       int timeout = 0;
+      char *p;
+
+      char *refresh = find_attr (tag, "content", &attrind);
+      if (!refresh)
+       return;
 
       for (p = refresh; ISDIGIT (*p); p++)
        timeout = 10 * timeout + *p - '0';