return even earlier

This commit is contained in:
Sebastian Ramacher 2011-10-19 09:46:48 +02:00
parent 721d566881
commit 843a0513e2

View File

@ -147,6 +147,10 @@ error_free:
girara_completion_t*
cc_bookmarks(girara_session_t* session, const char* input)
{
if (input == NULL) {
return NULL;
}
g_return_val_if_fail(session != NULL, NULL);
g_return_val_if_fail(session->global.data != NULL, NULL);
zathura_t* zathura = session->global.data;
@ -158,10 +162,6 @@ cc_bookmarks(girara_session_t* session, const char* input)
goto error_free;
}
if (!input) {
goto error_free;
}
const size_t input_length = strlen(input);
GIRARA_LIST_FOREACH(zathura->bookmarks.bookmarks, zathura_bookmark_t*, iter, bookmark)
if (input_length <= strlen(bookmark->id) && !strncmp(input, bookmark->id, input_length)) {