Commit 6fcb6900 authored by Craig Small's avatar Craig Small

watch: interpret esc[m sequence

Commit 99fa7f removed watch crashing from having the null ANSI
sequence. However it just ignored that sequence instead of fixing it.

This change correctly checks buf (not undefined endptr) and sends
the reset attribute if found.

Closes: #12
parent 94e4749b
......@@ -228,6 +228,9 @@ static void process_ansi(FILE * fp)
* attributes to apply, but typically there are between 1 and 3.
*/
/* Special case of <ESC>[m */
if (buf[0] == '\0')
set_ansi_attribute(0);
for (endptr = numstart = buf; *endptr != '\0'; numstart = endptr + 1) {
set_ansi_attribute(strtol(numstart, &endptr, 10));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment