diff --git a/src/global.c b/src/global.c index 136058e0..4ac369b5 100644 --- a/src/global.c +++ b/src/global.c @@ -1699,13 +1699,13 @@ sc *strtosc(const char *input) return s; } -/* Interpret a menu name and return the corresponding menu flag. */ -int strtomenu(const char *input) +/* Return the symbol that corresponds to the given menu name. */ +int name_to_menu(const char *name) { int index = -1; while (++index < NUMBER_OF_MENUS) - if (strcasecmp(input, menunames[index]) == 0) + if (strcasecmp(name, menunames[index]) == 0) return menusymbols[index]; return -1; diff --git a/src/proto.h b/src/proto.h index 725543ab..b59ba0b4 100644 --- a/src/proto.h +++ b/src/proto.h @@ -328,9 +328,11 @@ void set_speller_shortcut(void); #endif const subnfunc *sctofunc(const sc *s); const char *flagtostr(int flag); +#ifdef ENABLE_NANORC sc *strtosc(const char *input); -int strtomenu(const char *input); +int name_to_menu(const char *name); char *menu_to_name(int menu); +#endif #ifdef DEBUG void thanks_for_all_the_fish(void); #endif diff --git a/src/rcfile.c b/src/rcfile.c index d9b78a48..08de4d67 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -422,7 +422,7 @@ void parse_binding(char *ptr, bool dobind) } } - menu = strtomenu(menuptr); + menu = name_to_menu(menuptr); if (menu < 1) { rcfile_error(N_("Cannot map name \"%s\" to a menu"), menuptr); goto free_things;