[devhelp] Check link attribute values before comparing them
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [devhelp] Check link attribute values before comparing them
- Date: Fri, 28 Aug 2009 17:49:57 +0000 (UTC)
commit 54c00cf0b128793dbff23dede826cefc37bb935d
Author: Frédéric Péters <fpeters 0d be>
Date: Fri Aug 28 19:49:24 2009 +0200
Check link attribute values before comparing them
src/dh-keyword-model.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/dh-keyword-model.c b/src/dh-keyword-model.c
index 2304950..c46872a 100644
--- a/src/dh-keyword-model.c
+++ b/src/dh-keyword-model.c
@@ -361,6 +361,7 @@ keyword_model_search (DhKeywordModel *model,
found = FALSE;
if (book_id &&
+ dh_link_get_book_id (link) &&
strcmp (dh_link_get_book_id (link), book_id) != 0) {
continue;
}
@@ -402,9 +403,10 @@ keyword_model_search (DhKeywordModel *model,
new_list = g_list_prepend (new_list, link);
hits++;
- if (!*exact_link && (
+ if (!*exact_link &&
+ dh_link_get_name (link) && (
(dh_link_get_link_type (link) == DH_LINK_TYPE_PAGE &&
- strcmp (dh_link_get_name (link), page_id) == 0) ||
+ page_id && strcmp (dh_link_get_name (link), page_id) == 0) ||
(strcmp (dh_link_get_name (link), string) == 0))) {
*exact_link = link;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]