/[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.73 by sysadm, Wed May 28 07:30:23 2025 UTC Revision 1.76 by sysadm, Thu May 29 02:21:31 2025 UTC
# Line 371  int display_file_ex(const char *filename Line 371  int display_file_ex(const char *filename
371                                          max_lines = SCREEN_ROWS - 1;                                          max_lines = SCREEN_ROWS - 1;
372                                          clrline(begin_line, SCREEN_ROWS);                                          clrline(begin_line, SCREEN_ROWS);
373                                          break;                                          break;
374                                    case KEY_ESC:
375                                  case KEY_LEFT:                                  case KEY_LEFT:
376                                  case 'q':                                  case 'q':
377                                  case 'Q':                                  case 'Q':
# Line 472  int show_bottom(const char *msg) Line 473  int show_bottom(const char *msg)
473          char str_time[LINE_BUFFER_LEN];          char str_time[LINE_BUFFER_LEN];
474          time_t time_online;          time_t time_online;
475          struct tm *tm_online;          struct tm *tm_online;
476          char msg_f[21];          char msg_f[23];
477          int eol;          int eol;
478          int msg_len;          int msg_len;
479          int len;          int len;
# Line 480  int show_bottom(const char *msg) Line 481  int show_bottom(const char *msg)
481    
482          get_time_str(str_time, sizeof(str_time));          get_time_str(str_time, sizeof(str_time));
483    
484          strncpy(msg_f, msg, sizeof(msg_f) - 1);          msg_f[0] = '\0';
485          msg_f[sizeof(msg_f) - 1] = '\0';          msg_len = 0;
486            if (msg != NULL && msg[0] != '\0')
487          len = split_line(msg_f, 20, &eol, &msg_len);          {
488          msg_f[len] = '\0';                  msg_f[0] = '[';
489                    strncpy(msg_f + 1, msg, sizeof(msg_f) - 2);
490                    msg_f[sizeof(msg_f) - 1] = '\0';
491                    len = split_line(msg_f + 1, 20, &eol, &msg_len);
492                    msg_f[len + 1] = ']';
493                    msg_f[len + 2] = '\0';
494                    msg_len += 2;
495            }
496    
497          len_username = (int)strnlen(BBS_username, sizeof(BBS_username));          len_username = (int)strnlen(BBS_username, sizeof(BBS_username));
498    
# Line 493  int show_bottom(const char *msg) Line 501  int show_bottom(const char *msg)
501    
502          moveto(SCREEN_ROWS, 0);          moveto(SCREEN_ROWS, 0);
503          clrtoeol();          clrtoeol();
504          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]"
505                     "[\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",
506                     str_time, 21, msg_f, 9 - len_username, "", BBS_username,                     str_time, msg_f, 34 - msg_len - len_username, "", BBS_username,
507                     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);
508    
509          return 0;          return 0;


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

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