watch: Fix ANSI escape sequence termination
process_ansi stopped processing an ANSI escape sequence if (c < '0' && c > '9' && c != ';'), which will never happen. Fix the range check to use || instead. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
This commit is contained in:
parent
261c571aca
commit
f9a4fef6a9
2
watch.c
2
watch.c
@ -216,7 +216,7 @@ static void process_ansi(FILE * fp)
|
||||
buf[i] = '\0';
|
||||
break;
|
||||
}
|
||||
if (c < '0' && c > '9' && c != ';') {
|
||||
if ((c < '0' || c > '9') && c != ';') {
|
||||
while (--i >= 0)
|
||||
ungetc(buf[i], fp);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user