epiphany r8669 - branches/gnome-2-24/src/bookmarks



Author: diegoe
Date: Sun Jan  4 21:01:27 2009
New Revision: 8669
URL: http://svn.gnome.org/viewvc/epiphany?rev=8669&view=rev

Log:
Fix bookmark import of ff3 files

ff3 now has some extra stuff in their .html files, so the importer is not
always working, the regexp has been improved to fix this.
Patch by Wouter Bolsterlee. Fixes bug #552997.

Modified:
   branches/gnome-2-24/src/bookmarks/ephy-bookmarks-import.c

Modified: branches/gnome-2-24/src/bookmarks/ephy-bookmarks-import.c
==============================================================================
--- branches/gnome-2-24/src/bookmarks/ephy-bookmarks-import.c	(original)
+++ branches/gnome-2-24/src/bookmarks/ephy-bookmarks-import.c	Sun Jan  4 21:01:27 2009
@@ -550,8 +550,9 @@
 	 */
 	
 	/* check if it's a bookmark */
-	regex = g_regex_new ("<a href=\"(?P<url>\\w.*)\".*>(?P<name>\\w.*)</a>", 
-				G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY, NULL);
+	regex = g_regex_new
+		 ("<a href=\"(?P<url>[^\"]*).*?>\\s*(?P<name>.*?)\\s*</a>",
+		 G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY, NULL);
 	g_regex_match (regex, line, 0, &match_info);
 	
 	if (g_match_info_matches (match_info))
@@ -595,7 +596,7 @@
 		 * @regex. Note that this two free/unrefs correspond to the last 
 		 * if() block too.
 		 */
-        g_match_info_free (match_info);
+		g_match_info_free (match_info);
 		g_regex_unref (regex);
 
 		if (match_name)



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