/* This is called via menu_items_iter, so it returns a pointer to the item if the key matches, and returns NULL otherwise.  */
static void* menu_item_key_match(struct menu *m, struct menu_item *item, void *extra)
/* This is called via menu_items_iter, so it returns a pointer to the item if the key matches, and returns NULL otherwise.  */
static void* menu_item_key_match(struct menu *m, struct menu_item *item, void *extra)
{
	char *item_key = extra;
	if (!item_key || !item->key) {
		if (item_key == item->key)
			return item;
		return NULL;
	}
	if (strcmp(item->key, item_key) == 0)
		return item;
	return NULL;
}