Move queue init to caller so it's only called once in a few cases.

This commit is contained in:
okan 2017-04-24 13:35:25 +00:00
parent 15a6fcc851
commit 56b44257a5

View File

@ -152,8 +152,6 @@ search_match_path_type(struct menu_q *menuq, struct menu_q *resultq,
glob_t g;
int i;
TAILQ_INIT(resultq);
(void)strlcpy(pattern, search, sizeof(pattern));
(void)strlcat(pattern, "*", sizeof(pattern));
@ -170,6 +168,8 @@ search_match_path_type(struct menu_q *menuq, struct menu_q *resultq,
void
search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search)
{
TAILQ_INIT(resultq);
return(search_match_path_type(menuq, resultq, search, PATH_ANY));
}