From f759fe921aa2ba826e943d637b8282294708dc65 Mon Sep 17 00:00:00 2001 From: Alexander Butenko Date: Wed, 30 Jun 2010 12:16:05 -0400 Subject: [PATCH] Improve duplicate skipping logic in form history extension --- extensions/formhistory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } } -- 2.39.5