submodule.c: report the submodule that an error occurs in
[gitweb.git] / color.c
diff --git a/color.c b/color.c
index 31b6207a00de42a386e98c5656209ea7a010abe4..d48dd947c987cdca13f103fd8b4a2e56eceab238 100644 (file)
--- a/color.c
+++ b/color.c
@@ -329,8 +329,7 @@ static int check_auto_color(void)
        if (color_stdout_is_tty < 0)
                color_stdout_is_tty = isatty(1);
        if (color_stdout_is_tty || (pager_in_use() && pager_use_color)) {
-               char *term = getenv("TERM");
-               if (term && strcmp(term, "dumb"))
+               if (!is_terminal_dumb())
                        return 1;
        }
        return 0;
@@ -338,6 +337,13 @@ static int check_auto_color(void)
 
 int want_color(int var)
 {
+       /*
+        * NEEDSWORK: This function is sometimes used from multiple threads, and
+        * we end up using want_auto racily. That "should not matter" since
+        * we always write the same value, but it's still wrong. This function
+        * is listed in .tsan-suppressions for the time being.
+        */
+
        static int want_auto = -1;
 
        if (var < 0)