[cfe-commits] r71120 - in /cfe/trunk: test/TestRunner.sh tools/clang-cc/clang-cc.cpp
Daniel Dunbar
daniel at zuster.org
Wed May 6 14:28:43 PDT 2009
Author: ddunbar
Date: Wed May 6 16:28:42 2009
New Revision: 71120
URL: http://llvm.org/viewvc/llvm-project?rev=71120&view=rev
Log:
If stderr isn't a terminal, don't try to guess the terminal width or
look at COLUMNS.
Modified:
cfe/trunk/test/TestRunner.sh
cfe/trunk/tools/clang-cc/clang-cc.cpp
Modified: cfe/trunk/test/TestRunner.sh
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/TestRunner.sh?rev=71120&r1=71119&r2=71120&view=diff
==============================================================================
--- cfe/trunk/test/TestRunner.sh (original)
+++ cfe/trunk/test/TestRunner.sh Wed May 6 16:28:42 2009
@@ -18,9 +18,6 @@
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
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=71120&r1=71119&r2=71120&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Wed May 6 16:28:42 2009
@@ -1895,6 +1895,10 @@
/// \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 @@
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;
More information about the cfe-commits
mailing list