summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaulo Matos <pmatos@linki.tools>2021-05-17 18:54:36 +0200
committerGitHub <noreply@github.com>2021-05-17 09:54:36 -0700
commit9844548855f0ebe962d2167356b9a4b31c248a2b (patch)
tree3afd1dc5d39342721d200683d4fd0f6e7b9eb597 /src
parentdc516f10b5fa8fa7bf270eda97950d6e714956d3 (diff)
downloadbinaryen-9844548855f0ebe962d2167356b9a4b31c248a2b.tar.gz
binaryen-9844548855f0ebe962d2167356b9a4b31c248a2b.tar.bz2
binaryen-9844548855f0ebe962d2167356b9a4b31c248a2b.zip
Disable colors when writing module as text (#3890)
Via the C API.
Diffstat (limited to 'src')
-rw-r--r--src/binaryen-c.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index 4d0a04718..d308d88e4 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -3881,7 +3881,11 @@ BinaryenModuleAllocateAndWrite(BinaryenModuleRef module,
char* BinaryenModuleAllocateAndWriteText(BinaryenModuleRef module) {
std::stringstream ss;
+ bool colors = Colors::isEnabled();
+
+ Colors::setEnabled(false); // do not use colors for writing
ss << *(Module*)module;
+ Colors::setEnabled(colors); // restore colors state
const std::string out = ss.str();
const int len = out.length() + 1;