/[LeafOK_CVS]/lbbs/src/menu.c
ViewVC logotype

Diff of /lbbs/src/menu.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.32 by sysadm, Thu May 8 09:06:03 2025 UTC Revision 1.37 by sysadm, Sun May 11 13:50:15 2025 UTC
# Line 17  Line 17 
17  #include "bbs.h"  #include "bbs.h"
18  #include "bbs_cmd.h"  #include "bbs_cmd.h"
19  #include "user_priv.h"  #include "user_priv.h"
 #include "reg_ex.h"  
20  #include "bbs_cmd.h"  #include "bbs_cmd.h"
21  #include "menu.h"  #include "menu.h"
22  #include "log.h"  #include "log.h"
# Line 42  int load_menu(MENU_SET *p_menu_set, cons Line 41  int load_menu(MENU_SET *p_menu_set, cons
41          int i = 0;          int i = 0;
42          int j = 0;          int j = 0;
43          char buffer[LINE_BUFFER_LEN];          char buffer[LINE_BUFFER_LEN];
44            char temp[LINE_BUFFER_LEN];
45          char screen_filename[FILE_PATH_LEN];          char screen_filename[FILE_PATH_LEN];
46          char *p = NULL;          char *p = NULL;
47          char *q = NULL;          char *q = NULL;
# Line 83  int load_menu(MENU_SET *p_menu_set, cons Line 83  int load_menu(MENU_SET *p_menu_set, cons
83                          {                          {
84                                  if (p_menu != NULL)                                  if (p_menu != NULL)
85                                  {                                  {
86                                          log_error("Begin new menu without end the prior one, in menu config line %d\n", fin_line);                                          log_error("Incomplete menu definition in menu config line %d\n", fin_line);
87                                          return -1;                                          return -1;
88                                  }                                  }
89                                  p_menu = (MENU *)malloc(sizeof(MENU));                                  p_menu = (MENU *)malloc(sizeof(MENU));
# Line 521  int load_menu(MENU_SET *p_menu_set, cons Line 521  int load_menu(MENU_SET *p_menu_set, cons
521                                  {                                  {
522                                          fin_line++;                                          fin_line++;
523    
524                                          p = strtok_r(buffer, MENU_CONF_DELIM_WITH_SPACE, &saveptr);                                          strncpy(temp, buffer, sizeof(temp)); // Duplicate line for strtok_r
525                                            p = strtok_r(temp, MENU_CONF_DELIM_WITH_SPACE, &saveptr);
526                                          if (p != NULL && *p == '%') // END of menu screen                                          if (p != NULL && *p == '%') // END of menu screen
527                                          {                                          {
528                                                  break;                                                  break;
# Line 586  int display_menu(MENU *p_menu) Line 587  int display_menu(MENU *p_menu)
587                  return -1;                  return -1;
588          }          }
589    
590            if (p_menu->item_cur_pos > 0 &&
591                    checkpriv(&BBS_priv, 0, p_menu->items[p_menu->item_cur_pos]->priv) != 0 &&
592                    checklevel(&BBS_priv, p_menu->items[p_menu->item_cur_pos]->level) != 0)
593            {
594                    menu_selectable = 1;
595            }
596    
597          if (p_menu->title.show)          if (p_menu->title.show)
598          {          {
599                  show_top(p_menu->title.text);                  show_top(p_menu->title.text);
# Line 709  int menu_control(MENU_SET *p_menu_set, i Line 717  int menu_control(MENU_SET *p_menu_set, i
717                  {                  {
718                          display_menu_cursor(p_menu, 0);                          display_menu_cursor(p_menu, 0);
719                          p_menu->item_cur_pos = p_menu->item_count - 1;                          p_menu->item_cur_pos = p_menu->item_count - 1;
720                          while (!p_menu->items[p_menu->item_cur_pos]->display ||                          while (p_menu->item_cur_pos >= 0 && (!p_menu->items[p_menu->item_cur_pos]->display ||
721                                     p_menu->items[p_menu->item_cur_pos]->priv != 0 ||                                                                                                   p_menu->items[p_menu->item_cur_pos]->priv != 0 ||
722                                     p_menu->items[p_menu->item_cur_pos]->level != 0)                                                                                                   p_menu->items[p_menu->item_cur_pos]->level != 0))
723                          {                          {
724                                  p_menu->item_cur_pos--;                                  p_menu->item_cur_pos--;
725                          }                          }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1