diff options
author | Xan Lopez <xan@igalia.com> | 2012-04-03 04:37:54 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-04-03 04:54:59 +0800 |
commit | 6ff0b99cdee97cfa77456fe12f6b6c46081e0216 (patch) | |
tree | 511056c1bab666d26334122da3586e4743f202ca /src | |
parent | 2166ffba2bacc5680ad2e9c31dad1a4b3b53b565 (diff) | |
download | gsoc2013-epiphany-6ff0b99cdee97cfa77456fe12f6b6c46081e0216.tar gsoc2013-epiphany-6ff0b99cdee97cfa77456fe12f6b6c46081e0216.tar.gz gsoc2013-epiphany-6ff0b99cdee97cfa77456fe12f6b6c46081e0216.tar.bz2 gsoc2013-epiphany-6ff0b99cdee97cfa77456fe12f6b6c46081e0216.tar.lz gsoc2013-epiphany-6ff0b99cdee97cfa77456fe12f6b6c46081e0216.tar.xz gsoc2013-epiphany-6ff0b99cdee97cfa77456fe12f6b6c46081e0216.tar.zst gsoc2013-epiphany-6ff0b99cdee97cfa77456fe12f6b6c46081e0216.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-completion-model.c | 8 |
1 files 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; } |