From 56b44257a56417f038255c340f89eb3df90f1241 Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 24 Apr 2017 13:35:25 +0000 Subject: Move queue init to caller so it's only called once in a few cases. --- search.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search.c b/search.c index f244e7f..1dbf92b 100644 --- a/search.c +++ b/search.c @@ -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)); } -- cgit 1.4.1