aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2017-04-24 13:35:25 +0000
committerokan2017-04-24 13:35:25 +0000
commitf326ac175ef051168be14303baab0704c5306f6f (patch)
treeeb6fba95d46bd3878b6667168902841147f07e75
parent0f6618b0a6cd570a0d77a7cc702e384e1b2da85a (diff)
downloadcwm-f326ac175ef051168be14303baab0704c5306f6f.tar.gz
Move queue init to caller so it's only called once in a few cases.
-rw-r--r--search.c6
1 files 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 <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));
}