This fixes: <rdar://problem/
6164279> scan-build gives error when invoked without TERM variable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56110
91177308-0d34-0410-b5e6-
96231b3b80d8
my $BuildDate;
my $CXX; # Leave undefined initially.
-my $UseColor = ((($ENV{'TERM'} eq 'xterm-color') and -t STDOUT)
- and defined($ENV{'SCAN_BUILD_COLOR'}));
+my $TERM = $ENV{'TERM'};
+my $UseColor = (defined $TERM and $TERM eq 'xterm-color' and -t STDOUT
+ and defined $ENV{'SCAN_BUILD_COLOR'});
##----------------------------------------------------------------------------##
# Diagnostics