diff options
author | okan | 2016-12-01 20:28:19 +0000 |
---|---|---|
committer | okan | 2016-12-01 20:28:19 +0000 |
commit | 29118bc5f2d3da806407827df4b689bd80838a6f (patch) | |
tree | 82a1a451679725d504bd4643f0d6ac9d8c01eb59 /search.c | |
parent | 3e1ab95fb333a1c4cca76dfb5f2dc3bef7214bc2 (diff) | |
download | cwm-29118bc5f2d3da806407827df4b689bd80838a6f.tar.gz |
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 '')
-rw-r--r-- | search.c | 26 |
1 files changed, 7 insertions, 19 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.57 2016/10/24 18:57:12 okan Exp $ + * $OpenBSD: search.c,v 1.58 2016/12/01 20:28:19 okan Exp $ */ #include <sys/types.h> @@ -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 |