mirror of
https://github.com/systemd/systemd.git
synced 2026-08-09 17:38:42 +00:00
string-util: accept ":" when stripping ANSI color sequences
Since 6eabe9f2ff we generate sequences
with ":", hence we better also know how to strip them.
(Without this patch we'd strip simple ANSI colors, but not RGB ones that
use ":" syntax).
(While we are at it, also drop a duplicate "0" in the list of valid
chars)
This commit is contained in:
@@ -735,7 +735,7 @@ char* strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]) {
|
||||
case STATE_CSI:
|
||||
assert(n_carriage_returns == 0);
|
||||
|
||||
if (eot || !strchr("01234567890;m", *i)) { /* EOT or invalid chars in sequence */
|
||||
if (eot || !strchr(DIGITS ";:m", *i)) { /* EOT or invalid chars in sequence */
|
||||
fputc('\x1B', f);
|
||||
fputc('[', f);
|
||||
advance_offsets(i - *ibuf, highlight, shift, 2);
|
||||
|
||||
Reference in New Issue
Block a user