sync 098claws
[claws.git] / src / html.c
index 3f708a3a72786582b9fa8c692f6b87c30f6e0168..f10c55b26ae6739f9fca3ff0dfb6c0211793928c 100644 (file)
@@ -551,36 +551,38 @@ static HTMLTag *html_get_tag(const gchar *str)
 
                while (isspace(*tmpp)) tmpp++;
                attr_name = tmpp;
-               if ((p = strchr(attr_name, '=')) == NULL) {
-                       g_warning("html_get_tag(): syntax error in tag: '%s'\n", str);
-                       return tag;
+
+               while (*tmpp != '\0' && !isspace(*tmpp) && *tmpp != '=') tmpp++;
+               if (*tmpp != '\0' && *tmpp != '=') {
+                       *tmpp++ = '\0';
+                       while (isspace(*tmpp)) tmpp++;
                }
-               tmpp = p;
-               *tmpp++ = '\0';
-               while (isspace(*tmpp)) tmpp++;
 
-               if (*tmpp == '\0') {
-                       g_warning("html_get_tag(): syntax error in tag: '%s'\n", str);
-                       return tag;
-               } else if (*tmpp == '"' || *tmpp == '\'') {
-                       /* name="value" */
-                       quote = *tmpp;
-                       tmpp++;
-                       attr_value = tmpp;
-                       if ((p = strchr(attr_value, quote)) == NULL) {
-                               g_warning("html_get_tag(): syntax error in tag: '%s'\n", str);
-                               return tag;
-                       }
-                       tmpp = p;
+               if (*tmpp == '=') {
                        *tmpp++ = '\0';
                        while (isspace(*tmpp)) tmpp++;
-               } else {
-                       /* name=value */
-                       attr_value = tmpp;
-                       while (*tmpp != '\0' && !isspace(*tmpp)) tmpp++;
-                       if (*tmpp != '\0')
+
+                       if (*tmpp == '"' || *tmpp == '\'') {
+                               /* name="value" */
+                               quote = *tmpp;
+                               tmpp++;
+                               attr_value = tmpp;
+                               if ((p = strchr(attr_value, quote)) == NULL) {
+                                       g_warning("html_get_tag(): syntax error in tag: '%s'\n", str);
+                                       return tag;
+                               }
+                               tmpp = p;
                                *tmpp++ = '\0';
-               }
+                               while (isspace(*tmpp)) tmpp++;
+                       } else {
+                               /* name=value */
+                               attr_value = tmpp;
+                               while (*tmpp != '\0' && !isspace(*tmpp)) tmpp++;
+                               if (*tmpp != '\0')
+                                       *tmpp++ = '\0';
+                       }
+               } else
+                       attr_value = "";
 
                g_strchomp(attr_name);
                g_strdown(attr_name);