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

Diff of /lbbs/src/lml.c

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

Revision 1.36 by sysadm, Thu Oct 30 07:51:47 2025 UTC Revision 1.37 by sysadm, Thu Oct 30 11:15:12 2025 UTC
# Line 18  Line 18 
18  #include "lml.h"  #include "lml.h"
19  #include "log.h"  #include "log.h"
20  #include "str_process.h"  #include "str_process.h"
21    #include <ctype.h>
22  #include <stdio.h>  #include <stdio.h>
23  #include <string.h>  #include <string.h>
24  #include <sys/param.h>  #include <sys/param.h>
# Line 251  int lml_render(const char *str_in, char Line 252  int lml_render(const char *str_in, char
252                          new_line = 0;                          new_line = 0;
253                  }                  }
254    
255                  if (str_in[i] == '\033' && str_in[i + 1] == '[') // Escape sequence -- copy directly                  if (str_in[i] == '\033' && str_in[i + 1] == '[') // Escape sequence
256                  {                  {
257                          for (k = i + 2; str_in[k] != '\0' && str_in[k] != 'm' && str_in[k] != '\033'; k++)                          for (k = i + 2; isdigit(str_in[k]) || str_in[k] == ';' || str_in[k] == '?'; k++)
258                                  ;                                  ;
259    
260                          if (str_in[k] != 'm') // invalid                          if (str_in[k] == 'm') // valid -- copy directly
261                            {
262                                    CHECK_AND_APPEND_OUTPUT(str_out, buf_len, j, str_in + i, k - i + 1, line_width);
263                            }
264                            else if (isalpha(str_in[k]))
265                            {
266                                    // unsupported ANSI CSI command
267                            }
268                            else
269                          {                          {
270                                  k--;                                  k--;
271                          }                          }
272    
                         CHECK_AND_APPEND_OUTPUT(str_out, buf_len, j, str_in + i, k - i + 1, line_width);  
273                          i = k;                          i = k;
274                          continue;                          continue;
275                  }                  }


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

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