diff options
Diffstat (limited to 'clang/tools/clang-cc/clang-cc.cpp')
-rw-r--r-- | clang/tools/clang-cc/clang-cc.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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; |