--- lbbs/src/menu.c 2025/05/02 03:34:58 1.23 +++ lbbs/src/menu.c 2025/05/04 14:54:55 1.25 @@ -31,6 +31,8 @@ #include #include +#define MENU_TEMP_DIR "var" + MENU_SET bbs_menu; int load_menu(MENU_SET *p_menu_set, const char *conf_file) @@ -38,7 +40,7 @@ int load_menu(MENU_SET *p_menu_set, cons FILE *fin, *fout; int i = 0, j; char buffer[LINE_BUFFER_LEN]; - char screen_filename[LINE_BUFFER_LEN]; + char screen_filename[FILE_PATH_LEN]; char temp[LINE_BUFFER_LEN]; regmatch_t pmatch[10]; @@ -62,7 +64,7 @@ int load_menu(MENU_SET *p_menu_set, cons strncpy(temp, buffer + pmatch[1].rm_so, pmatch[1].rm_eo - pmatch[1].rm_so); temp[pmatch[1].rm_eo - pmatch[1].rm_so] = '\0'; - sprintf(screen_filename, "%sMENU_SCR_%s", app_temp_dir, temp); + sprintf(screen_filename, "%s/MENU_SCR_%s", MENU_TEMP_DIR, temp); if ((fout = fopen(screen_filename, "w")) == NULL) { @@ -248,7 +250,7 @@ int load_menu(MENU_SET *p_menu_set, cons pmatch[3].rm_eo - pmatch[3].rm_so); temp[pmatch[3].rm_eo - pmatch[3].rm_so] = '\0'; sprintf(p_menu_set->p_menu[i]->screen.filename, - "%sMENU_SCR_%s", app_temp_dir, temp); + "%s/MENU_SCR_%s", MENU_TEMP_DIR, temp); continue; } } @@ -366,6 +368,7 @@ int menu_control(MENU_SET *p_menu_set, i switch (key) { case CR: + igetch(1); // Cleanup remaining '\n' in the buffer case KEY_RIGHT: if (p_menu->items[p_menu->item_cur_pos]->submenu) { @@ -456,7 +459,6 @@ int menu_control(MENU_SET *p_menu_set, i void unload_menu(MENU_SET *p_menu_set) { MENU *p_menu; - MENU_ITEM *p_menuitem; int i, j; for (i = 0; i < p_menu_set->menu_count; i++)