| 17 |
#include "common.h" |
#include "common.h" |
| 18 |
#include "log.h" |
#include "log.h" |
| 19 |
#include "str_process.h" |
#include "str_process.h" |
| 20 |
|
#include <ctype.h> |
| 21 |
#include <stdio.h> |
#include <stdio.h> |
| 22 |
#include <string.h> |
#include <string.h> |
| 23 |
|
|
| 38 |
|
|
| 39 |
if (skip_ctrl_seq && c == '\033' && str[i + 1] == '[') // Skip control sequence |
if (skip_ctrl_seq && c == '\033' && str[i + 1] == '[') // Skip control sequence |
| 40 |
{ |
{ |
| 41 |
i += 2; |
for (i = i + 2; isdigit(str[i]) || str[i] == ';' || str[i] == '?'; i++) |
| 42 |
while (str[i] != '\0' && str[i] != 'm') |
; |
| 43 |
|
|
| 44 |
|
if (str[i] == 'm') // valid |
| 45 |
|
{ |
| 46 |
|
// skip |
| 47 |
|
} |
| 48 |
|
else if (isalpha(str[i])) |
| 49 |
{ |
{ |
| 50 |
i++; |
// unsupported ANSI CSI command |
| 51 |
} |
} |
| 52 |
|
else |
| 53 |
|
{ |
| 54 |
|
i--; |
| 55 |
|
} |
| 56 |
|
|
| 57 |
continue; |
continue; |
| 58 |
} |
} |
| 59 |
|
|