From 1c4483065b52383bb8e501e3a1e7c4f5628921cb Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 6 May 2009 21:28:42 +0000 Subject: [PATCH] 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 --- test/TestRunner.sh | 3 --- tools/clang-cc/clang-cc.cpp | 8 ++++---- 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("")); /// \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; -- 2.40.0