From f326ac175ef051168be14303baab0704c5306f6f 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/search.c b/search.c index 8c06f4d..523031c 100644 --- a/search.c +++ b/search.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: search.c,v 1.59 2016/12/06 21:54:10 okan Exp $ + * $OpenBSD: search.c,v 1.60 2017/04/24 13:35:25 okan Exp $ */ #include @@ -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 v1.2.3-2-gb3c3