summary refs log tree commit diff
path: root/search.c
diff options
context:
space:
mode:
authorokan <okan>2016-12-01 20:28:19 +0000
committerokan <okan>2016-12-01 20:28:19 +0000
commit94f681fc90229362e7e9bcc3c3699bb191f61ccc (patch)
tree1bff4f975c2e84e8a80261089958973ba00fd8ef /search.c
parentb94f0748d8872fa52f6c4f0e2feeba8e2dae131e (diff)
downloadcwm-94f681fc90229362e7e9bcc3c3699bb191f61ccc.tar.gz
cwm-94f681fc90229362e7e9bcc3c3699bb191f61ccc.tar.xz
cwm-94f681fc90229362e7e9bcc3c3699bb191f61ccc.zip
Tame the number of 'exec' and 'path' search_match wrappers. No functional
change now, though more can likely go later, losing the (paritally complete or
incomplete/broken) argument completion bits.
Diffstat (limited to 'search.c')
-rw-r--r--search.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/search.c b/search.c
index 89d4911..ae7ee0f 100644
--- a/search.c
+++ b/search.c
@@ -36,10 +36,8 @@
 #define PATH_ANY 	0x0001
 #define PATH_EXEC 	0x0002
 
-static void	search_match_path(struct menu_q *, struct menu_q *,
+static void	search_match_path_type(struct menu_q *, struct menu_q *,
 		    char *, int);
-static void	search_match_path_exec(struct menu_q *, struct menu_q *,
-		    char *);
 static int	strsubmatch(char *, char *, int);
 
 void
@@ -141,7 +139,8 @@ search_print_client(struct menu *mi, int list)
 }
 
 static void
-search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search, int flag)
+search_match_path_type(struct menu_q *menuq, struct menu_q *resultq,
+    char *search, int flag)
 {
 	char 	 pattern[PATH_MAX];
 	glob_t	 g;
@@ -162,16 +161,10 @@ search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search, in
 	globfree(&g);
 }
 
-static void
-search_match_path_exec(struct menu_q *menuq, struct menu_q *resultq, char *search)
-{
-	return(search_match_path(menuq, resultq, search, PATH_EXEC));
-}
-
 void
-search_match_path_any(struct menu_q *menuq, struct menu_q *resultq, char *search)
+search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search)
 {
-	return(search_match_path(menuq, resultq, search, PATH_ANY));
+	return(search_match_path_type(menuq, resultq, search, PATH_ANY));
 }
 
 void
@@ -208,14 +201,9 @@ search_match_exec(struct menu_q *menuq, struct menu_q *resultq, char *search)
 		if (mj == NULL)
 			TAILQ_INSERT_TAIL(resultq, mi, resultentry);
 	}
-}
 
-void
-search_match_exec_path(struct menu_q *menuq, struct menu_q *resultq, char *search)
-{
-	search_match_exec(menuq, resultq, search);
 	if (TAILQ_EMPTY(resultq))
-		search_match_path_exec(menuq, resultq, search);
+		search_match_path_type(menuq, resultq, search, PATH_EXEC);
 }
 
 static int