bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtextstyle-optional tests: Support the NO_COLOR environment variable


From: Bruno Haible
Subject: libtextstyle-optional tests: Support the NO_COLOR environment variable
Date: Wed, 14 Aug 2019 02:52:05 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-157-generic; KDE/5.18.0; x86_64; ; )

This patch keeps the libtextstyle-optional test in sync with a recent change
in libtextstyle.
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=7040b13946b3dce5fbe2be8ecfda11e03eed7028


2019-08-13  Bruno Haible  <address@hidden>

        libtextstyle-optional tests: Support the NO_COLOR environment variable.
        * tests/test-libtextstyle.c (main): Do not emit styling when the
        environment variable NO_COLOR is set.

diff --git a/tests/test-libtextstyle.c b/tests/test-libtextstyle.c
index 970713f..a6567f9 100644
--- a/tests/test-libtextstyle.c
+++ b/tests/test-libtextstyle.c
@@ -57,7 +57,9 @@ main (int argc, char *argv[])
 
   #if HAVE_LIBTEXTSTYLE
   if (color_mode == color_yes
-      || (color_mode == color_tty && isatty (STDOUT_FILENO))
+      || (color_mode == color_tty
+          && isatty (STDOUT_FILENO)
+          && getenv ("NO_COLOR") == NULL)
       || color_mode == color_html)
     {
       /* If no style file is explicitly specified, use the default in the




reply via email to

[Prev in Thread] Current Thread [Next in Thread]