Rename text_len to input_len

This commit is contained in:
adnano 2024-03-02 07:32:43 -05:00
parent ff4d1f8f8e
commit b247119ab3

6
menu.c
View file

@ -223,9 +223,9 @@ static void match_items(struct menu *menu) {
menu->matches_end = NULL; menu->matches_end = NULL;
menu->sel = NULL; menu->sel = NULL;
size_t text_len = strlen(menu->input); size_t input_len = strlen(menu->input);
/* tokenize text by space for matching the tokens individually */ /* tokenize input by space for matching the tokens individually */
strcpy(buf, menu->input); strcpy(buf, menu->input);
tok = strtok(buf, " "); tok = strtok(buf, " ");
while (tok) { while (tok) {
@ -253,7 +253,7 @@ static void match_items(struct menu *menu) {
/* not all tokens match */ /* not all tokens match */
continue; continue;
} }
if (!tokc || !menu->strncmp(menu->input, item->text, text_len + 1)) { if (!tokc || !menu->strncmp(menu->input, item->text, input_len + 1)) {
append_item(item, &lexact, &exactend); append_item(item, &lexact, &exactend);
} else if (!menu->strncmp(tokv[0], item->text, tok_len)) { } else if (!menu->strncmp(tokv[0], item->text, tok_len)) {
append_item(item, &lprefix, &prefixend); append_item(item, &lprefix, &prefixend);