diff options
author | okan | 2017-04-24 13:35:25 +0000 |
---|---|---|
committer | okan | 2017-04-24 13:35:25 +0000 |
commit | f326ac175ef051168be14303baab0704c5306f6f (patch) | |
tree | eb6fba95d46bd3878b6667168902841147f07e75 | |
parent | 0f6618b0a6cd570a0d77a7cc702e384e1b2da85a (diff) | |
download | cwm-f326ac175ef051168be14303baab0704c5306f6f.tar.gz |
Move queue init to caller so it's only called once in a few cases.
-rw-r--r-- | search.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 <sys/types.h> @@ -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)); } |