summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLoo Rong Jie <loorongjie@gmail.com>2016-11-12 01:41:59 +0800
committerAlon Zakai <alonzakai@gmail.com>2016-11-11 09:41:59 -0800
commit08050a4cc65958c92dbfbd62dfdaf8031beb3955 (patch)
treeb0dfd80a3cbf11ac0d4ad7d950c1ff26a12e3c27 /src
parentd0ee29345f9c697073d5dee7949dae0ee45be836 (diff)
downloadbinaryen-08050a4cc65958c92dbfbd62dfdaf8031beb3955.tar.gz
binaryen-08050a4cc65958c92dbfbd62dfdaf8031beb3955.tar.bz2
binaryen-08050a4cc65958c92dbfbd62dfdaf8031beb3955.zip
Fix Windows colors (#833)
* Fix Windows colors and update README.md
Diffstat (limited to 'src')
-rw-r--r--src/support/colors.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/support/colors.cpp b/src/support/colors.cpp
index 9a3b04f70..7d78306e0 100644
--- a/src/support/colors.cpp
+++ b/src/support/colors.cpp
@@ -43,9 +43,8 @@ void Colors::outputColorCode(std::ostream& stream, const char* colorCode) {
void Colors::outputColorCode(std::ostream&stream, const WORD &colorCode) {
const static bool has_color = []() {
- return (getenv("COLORS") && getenv("COLORS")[0] == '1') || // forced
- (_isatty(_fileno(stdout)) &&
- (!getenv("COLORS") || getenv("COLORS")[0] != '0')); // implicit
+ return _isatty(_fileno(stdout)) &&
+ (!getenv("COLORS") || getenv("COLORS")[0] != '0'); // implicit
}();
static HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
static HANDLE hStderr = GetStdHandle(STD_ERROR_HANDLE);