summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-06 21:28:42 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-06 21:28:42 +0000
commit908a66dc9b2579dbdb56ad1cbdf1bc7fd299f9cb (patch)
treea93285ab0c0104a787a703927418cf9ccd7313a9
parent4d11693f33b650a1c595b71360856a0abebdc018 (diff)
downloadbcm5719-llvm-908a66dc9b2579dbdb56ad1cbdf1bc7fd299f9cb.tar.gz
bcm5719-llvm-908a66dc9b2579dbdb56ad1cbdf1bc7fd299f9cb.zip
If stderr isn't a terminal, don't try to guess the terminal width or
look at COLUMNS. llvm-svn: 71120
-rwxr-xr-xclang/test/TestRunner.sh3
-rw-r--r--clang/tools/clang-cc/clang-cc.cpp8
2 files changed, 4 insertions, 7 deletions
diff --git a/clang/test/TestRunner.sh b/clang/test/TestRunner.sh
index 48b48d5a29c..bb20728578c 100755
--- a/clang/test/TestRunner.sh
+++ b/clang/test/TestRunner.sh
@@ -18,9 +18,6 @@ TESTNAME=$1
SUBST=$1
FILEDIR=`dirname $TESTNAME`
-# Make diagnostic printing more determinstic.
-export COLUMNS=0
-
OUTPUT=Output/$1.out
# create the output directory if it does not already exist
diff --git a/clang/tools/clang-cc/clang-cc.cpp b/clang/tools/clang-cc/clang-cc.cpp
index 3282c193de4..f71be5d5ea6 100644
--- a/clang/tools/clang-cc/clang-cc.cpp
+++ b/clang/tools/clang-cc/clang-cc.cpp
@@ -1895,6 +1895,10 @@ InputFilenames(llvm::cl::Positional, llvm::cl::desc("<input files>"));
/// \returns the width of the terminal (in characters), if there is a
/// terminal. If there is no terminal, returns 0.
static unsigned getTerminalWidth() {
+ // Is this a terminal? If not, don't wrap by default.
+ if (!llvm::sys::Process::StandardErrIsDisplayed())
+ return 0;
+
// If COLUMNS is defined in the environment, wrap to that many columns.
if (const char *ColumnsStr = std::getenv("COLUMNS")) {
int Columns = atoi(ColumnsStr);
@@ -1902,10 +1906,6 @@ static unsigned getTerminalWidth() {
return Columns;
}
- // Is this a terminal? If not, don't wrap by default.
- if (!llvm::sys::Process::StandardErrIsDisplayed())
- return 0;
-
#if HAVE_SYS_TYPES_H
// Try to determine the width of the terminal.
struct winsize ws;
OpenPOWER on IntegriCloud