]> granicus.if.org Git - procps-ng/commitdiff
watch: avoid ansi manipulations in non-ansi mode
authorJaromir Capik <jcapik@redhat.com>
Mon, 8 Sep 2014 16:28:08 +0000 (18:28 +0200)
committerJaromir Capik <jcapik@redhat.com>
Mon, 8 Sep 2014 16:28:08 +0000 (18:28 +0200)
watch.c

diff --git a/watch.c b/watch.c
index 5c177a2828ea28db4cb1b53b1452f7275586c683..c6ef38926fe97dc42aadbb974de97a43ab016ecb 100644 (file)
--- a/watch.c
+++ b/watch.c
@@ -474,7 +474,8 @@ static int run_command(char *restrict command, char **restrict command_argv)
        reset_ansi();
        for (y = show_title; y < height; y++) {
                int eolseen = 0, tabpending = 0, tabwaspending = 0;
-               set_ansi_attribute(-1);
+               if (flags & WATCH_COLOR)
+                       set_ansi_attribute(-1);
 #ifdef WITH_WATCH8BIT
                wint_t carry = WEOF;
 #endif