gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r9837 - Extractor/src/plugins


From: gnunet
Subject: [GNUnet-SVN] r9837 - Extractor/src/plugins
Date: Mon, 21 Dec 2009 12:35:25 +0100

Author: grothoff
Date: 2009-12-21 12:35:25 +0100 (Mon, 21 Dec 2009)
New Revision: 9837

Modified:
   Extractor/src/plugins/html_extractor.c
Log:
fixing CID 208

Modified: Extractor/src/plugins/html_extractor.c
===================================================================
--- Extractor/src/plugins/html_extractor.c      2009-12-21 11:18:16 UTC (rev 
9836)
+++ Extractor/src/plugins/html_extractor.c      2009-12-21 11:35:25 UTC (rev 
9837)
@@ -1,6 +1,6 @@
 /*
      This file is part of libextractor.
-     (C) 2002, 2003, 2004, 2005 Vidyut Samanta and Christian Grothoff
+     (C) 2002, 2003, 2004, 2005, 2009 Vidyut Samanta and Christian Grothoff
 
      libextractor is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -155,7 +155,7 @@
       start++;
       if (start[len] != '=')
         continue;
-      if (0 == strncmp (start, key, len))
+      if (0 == strncasecmp (start, key, len))
         {
           start += len + 1;
           *mstart = start;
@@ -314,7 +314,7 @@
       /* ideally, tmp == "test/html; charset=ISO-XXXX-Y" or something like 
that;
          if text/html is present, we take that as the mime-type; if charset=
          is present, we try to use that for character set conversion. */
-      if (0 == strncmp (tmp, "text/html", strlen ("text/html")))
+      if (0 == strncasecmp (tmp, "text/html", strlen ("text/html")))
         ret = proc (proc_cls, 
                    "html",
                    EXTRACTOR_METATYPE_MIMETYPE,
@@ -322,7 +322,7 @@
                    "text/plain",
                    "text/html",
                    strlen ("text/html")+1);
-      charset = strstr (tmp, "charset=");
+      charset = strcasestr (tmp, "charset=");
       if (charset != NULL)
         charset = strdup (&charset[strlen ("charset=")]);
       free (tmp);
@@ -356,8 +356,8 @@
                          strlen (xtmp) + 1);
              free (xtmp);
            }
-          free (tmp);
         }
+      free (tmp);
       i++;
     }
   while (tags != NULL) 
@@ -382,8 +382,8 @@
            }
          else
            {
-             xtmp = EXTRACTOR_common_convert_to_utf8 (tmp,
-                                                      strlen (tmp),
+             xtmp = EXTRACTOR_common_convert_to_utf8 (t->dataStart,
+                                                      t->dataEnd - 
t->dataStart,
                                                       charset);
              ret = proc (proc_cls,
                          "html",





reply via email to

[Prev in Thread] Current Thread [Next in Thread]