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

Diff of /lbbs/src/editor.c

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

Revision 1.25 by sysadm, Mon Jun 16 05:35:05 2025 UTC Revision 1.27 by sysadm, Tue Jun 17 02:06:48 2025 UTC
# Line 14  Line 14 
14   *                                                                         *   *                                                                         *
15   ***************************************************************************/   ***************************************************************************/
16    
17    #define _POSIX_C_SOURCE 200809L
18    
19  #include "editor.h"  #include "editor.h"
20  #include "bbs.h"  #include "bbs.h"
21  #include "io.h"  #include "io.h"
# Line 24  Line 26 
26  #include <stdlib.h>  #include <stdlib.h>
27  #include <sys/param.h>  #include <sys/param.h>
28  #include <strings.h>  #include <strings.h>
   
 #define _POSIX_C_SOURCE 200809L  
29  #include <string.h>  #include <string.h>
30    
31  #define EDITOR_ESC_DISPLAY_STR "\033[32m*\033[m"  #define EDITOR_ESC_DISPLAY_STR "\033[32m*\033[m"
# Line 138  EDITOR_DATA *editor_data_load(const char Line 138  EDITOR_DATA *editor_data_load(const char
138                  p_data_line[current_data_line_length] = '\0';                  p_data_line[current_data_line_length] = '\0';
139          }          }
140    
141          bzero(p_editor_data->p_display_lines + p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES - (size_t)p_editor_data->display_line_total);          memset(p_editor_data->p_display_lines + p_editor_data->display_line_total, 0, MAX_EDITOR_DATA_LINES - (size_t)p_editor_data->display_line_total);
142    
143          return p_editor_data;          return p_editor_data;
144  }  }
# Line 708  int editor_display(EDITOR_DATA *p_editor Line 708  int editor_display(EDITOR_DATA *p_editor
708                                  if ((ch >= 32 && ch < 127) || (ch > 127 && ch <= 255 && str_len == 2) || // Printable character or GBK                                  if ((ch >= 32 && ch < 127) || (ch > 127 && ch <= 255 && str_len == 2) || // Printable character or GBK
709                                          ch == CR || ch == KEY_ESC)                                                                                       // Special character                                          ch == CR || ch == KEY_ESC)                                                                                       // Special character
710                                  {                                  {
711                                          BBS_last_access_tm = time(0);                                          BBS_last_access_tm = time(NULL);
712    
713                                          if (str_len == 0) // ch >= 32 && ch < 127                                          if (str_len == 0) // ch >= 32 && ch < 127
714                                          {                                          {
# Line 784  int editor_display(EDITOR_DATA *p_editor Line 784  int editor_display(EDITOR_DATA *p_editor
784                                  }                                  }
785                                  else if (ch == KEY_DEL || ch == BACKSPACE) // Del                                  else if (ch == KEY_DEL || ch == BACKSPACE) // Del
786                                  {                                  {
787                                          BBS_last_access_tm = time(0);                                          BBS_last_access_tm = time(NULL);
788    
789                                          if (ch == BACKSPACE)                                          if (ch == BACKSPACE)
790                                          {                                          {
# Line 1061  int editor_display(EDITOR_DATA *p_editor Line 1061  int editor_display(EDITOR_DATA *p_editor
1061                                          break;                                          break;
1062                                  }                                  }
1063    
1064                                  BBS_last_access_tm = time(0);                                  BBS_last_access_tm = time(NULL);
1065    
1066                                  if (input_ok)                                  if (input_ok)
1067                                  {                                  {


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

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