The menu offsets are arbitrary, use a separate numbering scheme for user
items.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
{
struct pmenu *menu = cui->main;
struct cui_opt_data *cod;
{
struct pmenu *menu = cui->main;
struct cui_opt_data *cod;
+ static int user_idx = 0;
/* Was the edit cancelled? */
if (!bd) {
/* Was the edit cancelled? */
if (!bd) {
item->on_execute = cui_boot;
item->data = cod = talloc_zero(item, struct cui_opt_data);
item->on_execute = cui_boot;
item->data = cod = talloc_zero(item, struct cui_opt_data);
- cod->name = talloc_asprintf(cod, "User item %u:", insert_pt);
+ cod->name = talloc_asprintf(cod, "User item %u:", ++user_idx);
if (pmenu_item_setup(menu, item, insert_pt,
talloc_strdup(item, cod->name)) == NULL) {
talloc_free(item);
if (pmenu_item_setup(menu, item, insert_pt,
talloc_strdup(item, cod->name)) == NULL) {
talloc_free(item);