From: Alexander Butenko Date: Wed, 30 Jun 2010 16:16:05 +0000 (-0400) Subject: Improve duplicate skipping logic in form history extension X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f759fe921aa2ba826e943d637b8282294708dc65;p=midori Improve duplicate skipping logic in form history extension --- diff --git a/extensions/formhistory.c b/extensions/formhistory.c index 1dd535eb..a21b2577 100644 --- a/extensions/formhistory.c +++ b/extensions/formhistory.c @@ -166,16 +166,19 @@ formhistory_update_main_hash (gchar* key, if ((tmp = g_hash_table_lookup (global_keys, (gpointer)key))) { gchar* rvalue = g_strdup_printf ("\"%s\"",value); - if (!g_regex_match_simple (rvalue, tmp, + gchar* patt = g_regex_escape_string (rvalue, -1); + if (!g_regex_match_simple (patt, tmp, G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY)) { gchar* new_value = g_strdup_printf ("%s%s,", tmp, rvalue); g_hash_table_insert (global_keys, g_strdup (key), new_value); g_free (rvalue); + g_free (patt); } else { g_free (rvalue); + g_free (patt); return FALSE; } }