diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-04-22 14:37:32 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-04-22 14:37:32 +0000 |
commit | 3f7c60107842e822922c7d954aac6f76e56cfda3 (patch) | |
tree | c5faf7f0f9bfe4ef1c3fd9326e83bf588a8ddc16 | |
parent | 7eef1a387a6f70d892e720932bf8da7a97dfbba4 (diff) | |
download | netsurf-3f7c60107842e822922c7d954aac6f76e56cfda3.tar.gz netsurf-3f7c60107842e822922c7d954aac6f76e56cfda3.tar.bz2 |
Ensure we can search textplain again
svn path=/trunk/netsurf/; revision=10454
-rw-r--r-- | desktop/search.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/desktop/search.c b/desktop/search.c index f84f1f06e..4598e60f7 100644 --- a/desktop/search.c +++ b/desktop/search.c @@ -239,7 +239,7 @@ void search_text(const char *string, int string_len, { struct rect bounds; hlcache_handle *c; - struct box *box; + struct box *box = NULL; bool case_sensitive, forwards, showall; case_sensitive = ((flags & SEARCH_FLAG_CASE_SENSITIVE) != 0) ? @@ -255,11 +255,13 @@ void search_text(const char *string, int string_len, if ((!c) || (content_get_type(c) != CONTENT_HTML && content_get_type(c) != CONTENT_TEXTPLAIN)) return; + + if (content_get_type(c) == CONTENT_HTML) { + box = html_get_box_tree(c); - box = html_get_box_tree(c); - - if (!box) - return; + if (!box) + return; + } /* LOG(("do_search '%s' - '%s' (%p, %p) %p (%d, %d) %d", search_data.string, string, search_data.content, c, search_data.found->next, |