/[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.31 by sysadm, Thu May 8 08:05:58 2025 UTC Revision 1.36 by sysadm, Sat May 10 03:05:16 2025 UTC
# Line 42  int load_menu(MENU_SET *p_menu_set, cons Line 42  int load_menu(MENU_SET *p_menu_set, cons
42          int i = 0;          int i = 0;
43          int j = 0;          int j = 0;
44          char buffer[LINE_BUFFER_LEN];          char buffer[LINE_BUFFER_LEN];
45            char temp[LINE_BUFFER_LEN];
46          char screen_filename[FILE_PATH_LEN];          char screen_filename[FILE_PATH_LEN];
47          char *p = NULL;          char *p = NULL;
48          char *q = NULL;          char *q = NULL;
# Line 83  int load_menu(MENU_SET *p_menu_set, cons Line 84  int load_menu(MENU_SET *p_menu_set, cons
84                          {                          {
85                                  if (p_menu != NULL)                                  if (p_menu != NULL)
86                                  {                                  {
87                                          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);
88                                          return -1;                                          return -1;
89                                  }                                  }
90                                  p_menu = (MENU *)malloc(sizeof(MENU));                                  p_menu = (MENU *)malloc(sizeof(MENU));
# Line 306  int load_menu(MENU_SET *p_menu_set, cons Line 307  int load_menu(MENU_SET *p_menu_set, cons
307                                                  q = strtok_r(NULL, MENU_CONF_DELIM_WITHOUT_SPACE, &saveptr);                                                  q = strtok_r(NULL, MENU_CONF_DELIM_WITHOUT_SPACE, &saveptr);
308                                                  if (q == NULL || (q = strchr(q, '\"')) == NULL)                                                  if (q == NULL || (q = strchr(q, '\"')) == NULL)
309                                                  {                                                  {
310                                                          log_error("Error #1 menu item text in menu config line %d\n", fin_line);                                                          log_error("Error menu item text in menu config line %d\n", fin_line);
311                                                          return -1;                                                          return -1;
312                                                  }                                                  }
313                                                  q++;                                                  q++;
# Line 521  int load_menu(MENU_SET *p_menu_set, cons Line 522  int load_menu(MENU_SET *p_menu_set, cons
522                                  {                                  {
523                                          fin_line++;                                          fin_line++;
524    
525                                          p = strtok_r(buffer, MENU_CONF_DELIM_WITH_SPACE, &saveptr);                                          strncpy(temp, buffer, sizeof(temp)); // Duplicate line for strtok_r
526                                            p = strtok_r(temp, MENU_CONF_DELIM_WITH_SPACE, &saveptr);
527                                          if (p != NULL && *p == '%') // END of menu screen                                          if (p != NULL && *p == '%') // END of menu screen
528                                          {                                          {
529                                                  break;                                                  break;
# Line 586  int display_menu(MENU *p_menu) Line 588  int display_menu(MENU *p_menu)
588                  return -1;                  return -1;
589          }          }
590    
591            if (p_menu->item_cur_pos > 0 &&
592                    checkpriv(&BBS_priv, 0, p_menu->items[p_menu->item_cur_pos]->priv) != 0 &&
593                    checklevel(&BBS_priv, p_menu->items[p_menu->item_cur_pos]->level) != 0)
594            {
595                    menu_selectable = 1;
596            }
597    
598          if (p_menu->title.show)          if (p_menu->title.show)
599          {          {
600                  show_top(p_menu->title.text);                  show_top(p_menu->title.text);
# Line 709  int menu_control(MENU_SET *p_menu_set, i Line 718  int menu_control(MENU_SET *p_menu_set, i
718                  {                  {
719                          display_menu_cursor(p_menu, 0);                          display_menu_cursor(p_menu, 0);
720                          p_menu->item_cur_pos = p_menu->item_count - 1;                          p_menu->item_cur_pos = p_menu->item_count - 1;
721                          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 ||
722                                     p_menu->items[p_menu->item_cur_pos]->priv != 0 ||                                                                                                   p_menu->items[p_menu->item_cur_pos]->priv != 0 ||
723                                     p_menu->items[p_menu->item_cur_pos]->level != 0)                                                                                                   p_menu->items[p_menu->item_cur_pos]->level != 0))
724                          {                          {
725                                  p_menu->item_cur_pos--;                                  p_menu->item_cur_pos--;
726                          }                          }


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

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