aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-04-03 04:37:54 +0800
committerXan Lopez <xan@igalia.com>2012-04-03 04:47:25 +0800
commit7badce6f1015f28d2f01797d50d744aa0e62cc6e (patch)
tree3ca3f08336f6988a2fa50f3325d1b0c15cd51c47 /src
parentf056c1e715f4a3d0886b2fb0686f3f9bc3cbd74c (diff)
downloadgsoc2013-epiphany-7badce6f1015f28d2f01797d50d744aa0e62cc6e.tar
gsoc2013-epiphany-7badce6f1015f28d2f01797d50d744aa0e62cc6e.tar.gz
gsoc2013-epiphany-7badce6f1015f28d2f01797d50d744aa0e62cc6e.tar.bz2
gsoc2013-epiphany-7badce6f1015f28d2f01797d50d744aa0e62cc6e.tar.lz
gsoc2013-epiphany-7badce6f1015f28d2f01797d50d744aa0e62cc6e.tar.xz
gsoc2013-epiphany-7badce6f1015f28d2f01797d50d744aa0e62cc6e.tar.zst
gsoc2013-epiphany-7badce6f1015f28d2f01797d50d744aa0e62cc6e.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.c8
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;
}