Commit f384c912 authored by Moritz Lipp's avatar Moritz Lipp

Fix cc_bookmarks

parent 094262c5
......@@ -270,4 +270,3 @@ cmd_savef(girara_session_t* session, girara_list_t* argument_list)
return true;
}
......@@ -154,6 +154,10 @@ cc_bookmarks(girara_session_t* session, const char* input)
girara_completion_t* completion = girara_completion_init();
girara_completion_group_t* group = girara_completion_group_create(session, NULL);
if (completion == NULL || group == NULL) {
goto error_free;
}
const size_t input_length = input ? strlen(input) : 0;
GIRARA_LIST_FOREACH(zathura->bookmarks.bookmarks, zathura_bookmark_t*, iter, bookmark)
......@@ -164,5 +168,19 @@ cc_bookmarks(girara_session_t* session, const char* input)
}
GIRARA_LIST_FOREACH_END(zathura->bookmarks.bookmarks, zathura_bookmark_t*, iter, bookmark)
girara_completion_add_group(completion, group);
return completion;
error_free:
if (completion) {
girara_completion_free(completion);
}
if (group) {
girara_completion_group_free(group);
}
return NULL;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment