From 519c98f07c8ab733cc465bb633eb69c2b0b8f815 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Mon, 27 May 2013 21:12:50 +0200 Subject: [PATCH] Fixed function name typo. Also fixed error on completing url without any tags set. --- src/bookmark.c | 8 +++++--- src/completion.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bookmark.c b/src/bookmark.c index 4d3872b..09ba6f4 100644 --- a/src/bookmark.c +++ b/src/bookmark.c @@ -28,7 +28,7 @@ typedef struct { } Bookmark; static GList *load(const char *file); -static gboolean comtains_all_tags(char **src, unsigned int s, char **query, unsigned int q); +static gboolean contains_all_tags(char **src, unsigned int s, char **query, unsigned int q); static void free_bookmark(Bookmark *bm); /** @@ -72,7 +72,9 @@ GList *bookmark_get_by_tags(const char *tags) for (GList *l = src; l; l = l->next) { Bookmark *bm = (Bookmark*)l->data; - if (comtains_all_tags(bm->tags, g_strv_length(bm->tags), parts, len)) { + if (bm->tags + && contains_all_tags(bm->tags, g_strv_length(bm->tags), parts, len) + ) { res = g_list_prepend(res, g_strdup(bm->uri)); } } @@ -128,7 +130,7 @@ static GList *load(const char *file) * Checks if the given source array of pointer contains all those entries * given as array of search strings. */ -static gboolean comtains_all_tags(char **src, unsigned int s, char **query, unsigned int q) +static gboolean contains_all_tags(char **src, unsigned int s, char **query, unsigned int q) { unsigned int i, n; diff --git a/src/completion.c b/src/completion.c index 64114b9..7dc3981 100644 --- a/src/completion.c +++ b/src/completion.c @@ -100,7 +100,7 @@ gboolean completion_complete(gboolean back) g_list_free(source); } else if (type == VB_INPUT_OPEN || type == VB_INPUT_TABOPEN) { source = history_get_all(HISTORY_URL); - tmp = filter_list(tmp, source, (Comp_Func)util_strcasestr, suffix), + tmp = filter_list(tmp, source, (Comp_Func)util_strcasestr, suffix); /* prepend the bookmark items */ tmp = g_list_concat(bookmark_get_by_tags(suffix), tmp); comps.completions = init_completion(comps.completions, tmp, prefix); -- 2.20.1