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

Diff of /lbbs/src/screen.c

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

Revision 1.65 by sysadm, Mon May 19 06:55:06 2025 UTC Revision 1.69 by sysadm, Sun May 25 06:55:23 2025 UTC
# Line 241  int display_file_ex(const char *filename Line 241  int display_file_ex(const char *filename
241          long int percentile;          long int percentile;
242          int loop;          int loop;
243    
244          if ((p_shm = get_file_shm(filename, &data_len, &line_total, &p_data, &p_line_offsets)) == NULL)          if ((p_shm = get_file_shm_readonly(filename, &data_len, &line_total, &p_data, &p_line_offsets)) == NULL)
245          {          {
246                  log_error("get_file_shm(%s) error\n", filename);                  log_error("get_file_shm(%s) error\n", filename);
247                  return KEY_NULL;                  return KEY_NULL;
# Line 293  int display_file_ex(const char *filename Line 293  int display_file_ex(const char *filename
293                                  input_ok = 1;                                  input_ok = 1;
294                                  switch (ch)                                  switch (ch)
295                                  {                                  {
296                                  // case KEY_NULL:                                  case KEY_NULL:
297                                  case KEY_TIMEOUT:                                  case KEY_TIMEOUT:
298                                          goto cleanup;                                          goto cleanup;
299                                  case KEY_HOME:                                  case KEY_HOME:
# Line 419  int display_file_ex(const char *filename Line 419  int display_file_ex(const char *filename
419          }          }
420    
421  cleanup:  cleanup:
422            if (detach_file_shm(p_shm) < 0)
423            {
424                    log_error("detach_file_shm(%s) error\n", filename);
425            }
426    
427          return ch;          return ch;
428  }  }
429    
# Line 440  int show_top(const char *status) Line 445  int show_top(const char *status)
445                  status_f[len] = '\0';                  status_f[len] = '\0';
446          }          }
447    
448          len = split_line(BBS_current_section_name, 20, &truncate, &section_name_len);          len = split_line(BBS_current_section_name, BBS_section_name_max_len, &truncate, &section_name_len);
449          if (truncate)          if (truncate)
450          {          {
451                  log_error("Section name is truncated\n");                  log_error("Section name is truncated\n");
# Line 485  int show_bottom(const char *msg) Line 490  int show_bottom(const char *msg)
490          moveto(SCREEN_ROWS, 0);          moveto(SCREEN_ROWS, 0);
491          clrtoeol();          clrtoeol();
492          prints("\033[1;44;33m[\033[36m%s\033[33m]%*s%*sÕʺÅ[\033[36m%s\033[33m]"          prints("\033[1;44;33m[\033[36m%s\033[33m]%*s%*sÕʺÅ[\033[36m%s\033[33m]"
493                     "[\033[36m%1d\033[33m:\033[36m%2d\033[33m:\033[36m%2d\033[33m]\033[m",                     "[\033[36m%1d\033[33mÌì\033[36m%2d\033[33mʱ\033[36m%2d\033[33m·Ö]\033[m",
494                     str_time, 21, msg_f, 13 - len_username, "", BBS_username,                     str_time, 21, msg_f, 9 - len_username, "", BBS_username,
495                     tm_online->tm_mday - 1, tm_online->tm_hour, tm_online->tm_min);                     tm_online->tm_mday - 1, tm_online->tm_hour, tm_online->tm_min);
496    
497          return 0;          return 0;
# Line 509  int show_active_board() Line 514  int show_active_board()
514    
515          if (p_shm == NULL)          if (p_shm == NULL)
516          {          {
517                  if ((p_shm = get_file_shm(DATA_ACTIVE_BOARD, &data_len, &line_total, &p_data, &p_line_offsets)) == NULL)                  if ((p_shm = get_file_shm_readonly(DATA_ACTIVE_BOARD, &data_len, &line_total, &p_data, &p_line_offsets)) == NULL)
518                  {                  {
519                          log_error("get_file_shm(%s) error\n", DATA_ACTIVE_BOARD);                          log_error("get_file_shm(%s) error\n", DATA_ACTIVE_BOARD);
520                          return KEY_NULL;                          return KEY_NULL;


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

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