From 7badce6f1015f28d2f01797d50d744aa0e62cc6e Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Mon, 2 Apr 2012 22:37:54 +0200 Subject: ephy-completion-model: normalize NULL strings to "" in should_add_bookmark_to_model Otherwise we can get false positives in the regexp, since the previous attempt at normalization would not properly take NULL strings into account. https://bugzilla.gnome.org/show_bug.cgi?id=673301 --- src/ephy-completion-model.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ephy-completion-model.c b/src/ephy-completion-model.c index 8b8705947..d78e19dfd 100644 --- a/src/ephy-completion-model.c +++ b/src/ephy-completion-model.c @@ -261,10 +261,10 @@ should_add_bookmark_to_model (EphyCompletionModel *model, GRegex *current = NULL; for (iter = priv->search_terms; iter != NULL; iter = iter->next) { - current = (GRegex*) iter->data; - if (((title && !g_regex_match (current, title, G_REGEX_MATCH_NOTEMPTY, NULL))) && - ((location && !g_regex_match (current, location, G_REGEX_MATCH_NOTEMPTY, NULL))) && - ((keywords && !g_regex_match (current, keywords, G_REGEX_MATCH_NOTEMPTY, NULL)))) { + current = (GRegex*)iter->data; + if ((!g_regex_match (current, title ? title : "", G_REGEX_MATCH_NOTEMPTY, NULL)) && + (!g_regex_match (current, location ? location : "", G_REGEX_MATCH_NOTEMPTY, NULL)) && + (!g_regex_match (current, keywords ? keywords : "", G_REGEX_MATCH_NOTEMPTY, NULL))) { ret = FALSE; break; } -- cgit