summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2017-04-24 13:35:25 +0000
committerokan <okan>2017-04-24 13:35:25 +0000
commit56b44257a56417f038255c340f89eb3df90f1241 (patch)
tree32e5b74e56fbb03bd3131066ebf6904fcc29c391
parent15a6fcc851d0e04f1a53beec6b2db81109e9a058 (diff)
downloadcwm-56b44257a56417f038255c340f89eb3df90f1241.tar.gz
cwm-56b44257a56417f038255c340f89eb3df90f1241.tar.xz
cwm-56b44257a56417f038255c340f89eb3df90f1241.zip
Move queue init to caller so it's only called once in a few cases.
-rw-r--r--search.c4
1 files 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));
 }