Fixed function name typo.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 27 May 2013 19:12:50 +0000 (21:12 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 27 May 2013 19:12:50 +0000 (21:12 +0200)
Also fixed error on completing url without any tags set.

src/bookmark.c
src/completion.c

index 4d3872b..09ba6f4 100644 (file)
@@ -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;
 
index 64114b9..7dc3981 100644 (file)
@@ -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);