mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
move variable declarations up, to match everything else
This commit is contained in:
parent
add109c006
commit
64ff5f399a
11
search.c
11
search.c
@ -69,15 +69,16 @@ match_substr(char *sub, char *str, int zeroidx)
|
||||
void
|
||||
search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
||||
{
|
||||
struct winname *wn;
|
||||
struct menu *mi, *tierp[4], *before = NULL;
|
||||
struct client_ctx *cc;
|
||||
struct winname *wn;
|
||||
|
||||
(void)memset(tierp, 0, sizeof(tierp));
|
||||
|
||||
TAILQ_INIT(resultq);
|
||||
TAILQ_FOREACH(mi, menuq, entry) {
|
||||
int tier = -1, t;
|
||||
struct client_ctx *cc = (struct client_ctx *)mi->ctx;
|
||||
cc = (struct client_ctx *)mi->ctx;
|
||||
|
||||
/* Match on label. */
|
||||
if (match_substr(search, cc->label, 0))
|
||||
@ -133,10 +134,11 @@ void
|
||||
search_match_cmd(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
||||
{
|
||||
struct menu *mi;
|
||||
struct cmd_ctx *cmd;
|
||||
|
||||
TAILQ_INIT(resultq);
|
||||
TAILQ_FOREACH(mi, menuq, entry) {
|
||||
struct cmd_ctx *cmd = (struct cmd_ctx *)mi->ctx;
|
||||
cmd = (struct cmd_ctx *)mi->ctx;
|
||||
if (match_substr(search, cmd->name, 0))
|
||||
TAILQ_INSERT_TAIL(resultq, mi, resultentry);
|
||||
}
|
||||
@ -146,11 +148,12 @@ void
|
||||
search_match_group(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
||||
{
|
||||
struct menu *mi;
|
||||
struct group_ctx *gc;
|
||||
char *s;
|
||||
|
||||
TAILQ_INIT(resultq);
|
||||
TAILQ_FOREACH(mi, menuq, entry) {
|
||||
struct group_ctx *gc = (struct group_ctx *)mi->ctx;
|
||||
gc = (struct group_ctx *)mi->ctx;
|
||||
xasprintf(&s, "%d %s", gc->num, gc->name);
|
||||
if (match_substr(search, s, 0))
|
||||
TAILQ_INSERT_TAIL(resultq, mi, resultentry);
|
||||
|
Loading…
Reference in New Issue
Block a user