/[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.47 by sysadm, Thu Oct 16 11:26:16 2025 UTC Revision 1.48 by sysadm, Sat Oct 18 12:06:10 2025 UTC
# Line 504  int editor_data_delete(EDITOR_DATA *p_ed Line 504  int editor_data_delete(EDITOR_DATA *p_ed
504          {          {
505                  str_len = 1;                  str_len = 1;
506          }          }
507          else if (p_data_line[offset_data_line] & 0b10000000) // head of multi-byte character          else if (p_data_line[offset_data_line] & 0x80) // head of multi-byte character
508          {          {
509                  str_len = 1;                  str_len = 1;
510                  c = (p_data_line[offset_data_line] & 0b01110000) << 1;                  c = (p_data_line[offset_data_line] & 0x70) << 1;
511                  while (c & 0b10000000)                  while (c & 0x80)
512                  {                  {
513                          str_len++;                          str_len++;
514                          c = (c & 0b01111111) << 1;                          c = (c & 0x7f) << 1;
515                  }                  }
516          }          }
517          else          else
# Line 716  int editor_display(EDITOR_DATA *p_editor Line 716  int editor_display(EDITOR_DATA *p_editor
716                                          goto cleanup;                                          goto cleanup;
717                                  }                                  }
718    
719                                  if (ch < 256 && (ch & 0b10000000)) // head of multi-byte character                                  if (ch < 256 && (ch & 0x80)) // head of multi-byte character
720                                  {                                  {
721                                          str_len = 0;                                          str_len = 0;
722                                          c = (char)(ch & 0b11110000);                                          c = (char)(ch & 0xf0);
723                                          while (c & 0b10000000)                                          while (c & 0x80)
724                                          {                                          {
725                                                  input_str[str_len] = (char)(ch - 256);                                                  input_str[str_len] = (char)(ch - 256);
726                                                  str_len++;                                                  str_len++;
727                                                  c = (c & 0b01111111) << 1;                                                  c = (c & 0x7f) << 1;
728    
729                                                  if ((c & 0b10000000) == 0) // Input completed                                                  if ((c & 0x80) == 0) // Input completed
730                                                  {                                                  {
731                                                          break;                                                          break;
732                                                  }                                                  }


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

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