/[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.26 by sysadm, Mon Jun 16 14:30:44 2025 UTC Revision 1.29 by sysadm, Tue Jun 17 13:25:49 2025 UTC
# Line 14  Line 14 
14   *                                                                         *   *                                                                         *
15   ***************************************************************************/   ***************************************************************************/
16    
 #define _POSIX_C_SOURCE 200809L  
   
17  #include "editor.h"  #include "editor.h"
18  #include "bbs.h"  #include "bbs.h"
19  #include "io.h"  #include "io.h"
# Line 281  int editor_data_insert(EDITOR_DATA *p_ed Line 279  int editor_data_insert(EDITOR_DATA *p_ed
279          {          {
280                  if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES)                  if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES)
281                  {                  {
282                          // log_error("Split line error, display_line_total(%ld) reach limit(%d)\n",  #ifdef _DEBUG
283                          //                p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES);                          log_error("Split line error, display_line_total(%ld) reach limit(%d)\n",
284                                              p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES);
285    #endif
286    
287                          return -2;                          return -2;
288                  }                  }
289    
# Line 371  int editor_data_insert(EDITOR_DATA *p_ed Line 372  int editor_data_insert(EDITOR_DATA *p_ed
372                          // Insert blank display line after last_display_line                          // Insert blank display line after last_display_line
373                          if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES)                          if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES)
374                          {                          {
375                                  // log_error("display_line_total over limit %d >= %d\n", p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES);  #ifdef _DEBUG
376                                    log_error("display_line_total over limit %d >= %d\n", p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES);
377    #endif
378    
379                                  // Terminate prior display line with \n, to avoid error on cleanup                                  // Terminate prior display line with \n, to avoid error on cleanup
380                                  if (display_line + i - 1 >= 0 && p_editor_data->display_line_lengths[display_line + i - 1] > 0)                                  if (display_line + i - 1 >= 0 && p_editor_data->display_line_lengths[display_line + i - 1] > 0)
381                                  {                                  {
# Line 708  int editor_display(EDITOR_DATA *p_editor Line 712  int editor_display(EDITOR_DATA *p_editor
712                                  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
713                                          ch == CR || ch == KEY_ESC)                                                                                       // Special character                                          ch == CR || ch == KEY_ESC)                                                                                       // Special character
714                                  {                                  {
715                                          BBS_last_access_tm = time(0);                                          BBS_last_access_tm = time(NULL);
716    
717                                          if (str_len == 0) // ch >= 32 && ch < 127                                          if (str_len == 0) // ch >= 32 && ch < 127
718                                          {                                          {
# Line 784  int editor_display(EDITOR_DATA *p_editor Line 788  int editor_display(EDITOR_DATA *p_editor
788                                  }                                  }
789                                  else if (ch == KEY_DEL || ch == BACKSPACE) // Del                                  else if (ch == KEY_DEL || ch == BACKSPACE) // Del
790                                  {                                  {
791                                          BBS_last_access_tm = time(0);                                          BBS_last_access_tm = time(NULL);
792    
793                                          if (ch == BACKSPACE)                                          if (ch == BACKSPACE)
794                                          {                                          {
# Line 1061  int editor_display(EDITOR_DATA *p_editor Line 1065  int editor_display(EDITOR_DATA *p_editor
1065                                          break;                                          break;
1066                                  }                                  }
1067    
1068                                  BBS_last_access_tm = time(0);                                  BBS_last_access_tm = time(NULL);
1069    
1070                                  if (input_ok)                                  if (input_ok)
1071                                  {                                  {


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

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