From 8ad32809e1bf97ced654c3a7b85f267339aba3f2 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 1 Mar 2009 09:21:29 +0200 Subject: [PATCH] bug 153, 1066: Fix search in bookmark manager. test_search() was supposed to compare bookmark titles with strcasestr(), but in commit 311d95358de258656a0c7145a2dcff943fcdcd4b "bug 153, 1066: Convert bookmarks to/from UTF-8 when searching." on 2009-02-08, I inadvertently changed that to strcasecmp(), even while adding a comment about why strcasestr() is needed. strcasestr() returns non-NULL if the strings match, and strcasecmp() returns nonzero if they differ, so the search didn't work at all. --- src/bookmarks/dialogs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bookmarks/dialogs.c b/src/bookmarks/dialogs.c index 69340b17..b20815c0 100644 --- a/src/bookmarks/dialogs.c +++ b/src/bookmarks/dialogs.c @@ -687,8 +687,8 @@ test_search(struct listbox_item *item, void *data_, int *offset) } if (title) { - ctx->found = strcasecmp(title, - ctx->title); + ctx->found = (strcasestr(title, ctx->title) + != NULL); mem_free(title); } /** @todo Tell the user that the string could