Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 3 Apr 2014 20:18:26 +0000 (22:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 3 Apr 2014 20:18:26 +0000 (22:18 +0200)
* qatar/master:
  log: Do not assume the TERM variable is always set

Conflicts:
libavutil/log.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavutil/log.c

diff --cc libavutil/log.c
@@@ -129,9 -74,7 +129,9 @@@ static void check_color_terminal(void
      char *term = getenv("TERM");
      use_color = !getenv("NO_COLOR") && !getenv("AV_LOG_FORCE_NOCOLOR") &&
                  (getenv("TERM") && isatty(2) || getenv("AV_LOG_FORCE_COLOR"));
 -    use_color += term && strstr(term, "256color");
 +    if (   getenv("AV_LOG_FORCE_256COLOR")
-         || strstr(term, "256color"));
++        || (term && strstr(term, "256color")));
 +        use_color *= 256;
  #else
      use_color = getenv("AV_LOG_FORCE_COLOR") && !getenv("NO_COLOR") &&
                 !getenv("AV_LOG_FORCE_NOCOLOR");