Respect the COLUMNS environment variable for word-wrapping (so we get
word-wrapping by default in Emacs; yay!). Thanks, Daniel.

Use LLVM's System layer rather than calling isatty() directly.

Fix a thinko in printing the indentation string that was causing some
weird output.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70654 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp
index 017ead4..b8c10b5 100644
--- a/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -570,7 +570,8 @@
 
     // This word does not fit on the current line, so wrap to the next
     // line.
-    OS << '\n' << IndentStr.begin();
+    OS << '\n';
+    OS.write(&IndentStr[0], Indentation);
     OS.write(&Str[WordStart], WordLength);
     Column = Indentation + WordLength;
     Wrapped = true;