summaryrefslogtreecommitdiff
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
commit1c4483065b52383bb8e501e3a1e7c4f5628921cb (patch)
tree59572788399f23d07a206eba071fdd63aacc1f6b
parent17ca3638e852ba81f389e9f896ed0420b52ae606 (diff)
downloadclang-1c4483065b52383bb8e501e3a1e7c4f5628921cb.tar.gz
clang-1c4483065b52383bb8e501e3a1e7c4f5628921cb.tar.bz2
clang-1c4483065b52383bb8e501e3a1e7c4f5628921cb.tar.xz
If stderr isn't a terminal, don't try to guess the terminal width or
look at COLUMNS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71120 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xtest/TestRunner.sh3
-rw-r--r--tools/clang-cc/clang-cc.cpp8
2 files changed, 4 insertions, 7 deletions
diff --git a/test/TestRunner.sh b/test/TestRunner.sh
index 48b48d5a29..bb20728578 100755
--- a/test/TestRunner.sh
+++ b/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/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index 3282c193de..f71be5d5ea 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/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;