[kazehakase-svn] [3444] Extract file encoding more correctly.

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
Fri Mar 7 03:12:24 JST 2008


Revision: 3444
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3444
Author:   pal_gene
Date:     2008-03-07 03:12:24 +0900 (Fri, 07 Mar 2008)

Log Message:
-----------
Extract file encoding more correctly.

Modified Paths:
--------------
    kazehakase/trunk/module/search/kz-hyper-estraier-search.c

Modified: kazehakase/trunk/module/search/kz-hyper-estraier-search.c
===================================================================
--- kazehakase/trunk/module/search/kz-hyper-estraier-search.c	2008-03-06 18:12:21 UTC (rev 3443)
+++ kazehakase/trunk/module/search/kz-hyper-estraier-search.c	2008-03-06 18:12:24 UTC (rev 3444)
@@ -480,7 +480,7 @@
 	p = (gchar*)contents;
 	while ((p = strstr(p, "<meta ")))
 	{
-		gchar *end;
+		gchar *end, *quote_end;
 		p = strstr(p, "http-equiv=\"");
 		if (!p) break;
 
@@ -497,8 +497,8 @@
 		if (!p) break;
 		p+=8;
 		end = strchr(p, ';');
-		if (!end)
-			end = strchr(p, '"');
+		quote_end = strchr(p, '"');
+		if(quote_end && quote_end < end) end = quote_end;
 		if (!end) break;
 
 		encoding = g_strndup(p, end - p);
@@ -762,7 +762,7 @@
 					}
 					else
 					{
-						g_warning("encoding convert fail. [enc:file] [%s:%s]\n",
+						g_warning("failed convert encoding. [enc:file] [%s:%s]\n",
 						          encoding, new_path);
 					}
 				}




More information about the Kazehakase-cvs mailing list
Zurück zum Archiv-Index