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:
Josh Triplett 2016-07-08 00:29:59 -07:00 committed by Craig Small
parent 261c571aca
commit f9a4fef6a9

View File

@ -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;