summaryrefslogtreecommitdiff
path: root/libvaladoc/errorreporter.vala
diff options
context:
space:
mode:
authorwszqkzqk <wszqkzqk@qq.com>2023-01-03 23:12:24 +0800
committerRico Tzschichholz <ricotz@ubuntu.com>2023-01-04 11:09:26 +0100
commitd6b9e6aace8388d76a29b3df83413dec76324833 (patch)
tree9fd1d46c0a931fdbeb9ce56127e88fbf432087d0 /libvaladoc/errorreporter.vala
parentc5679d09cdc8b49c9b886fc6617db901350c301d (diff)
downloadvala-d6b9e6aace8388d76a29b3df83413dec76324833.tar.gz
vala,libvaladoc: Properly check for colored terminal output on Windows
Additionally look for `_isatty()` and adjust for more possible results Fixes https://gitlab.gnome.org/GNOME/vala/issues/1383
Diffstat (limited to 'libvaladoc/errorreporter.vala')
-rw-r--r--libvaladoc/errorreporter.vala7
1 files changed, 5 insertions, 2 deletions
diff --git a/libvaladoc/errorreporter.vala b/libvaladoc/errorreporter.vala
index 68b09a8ef..d63ed6ecd 100644
--- a/libvaladoc/errorreporter.vala
+++ b/libvaladoc/errorreporter.vala
@@ -240,11 +240,14 @@ public class Valadoc.ErrorReporter : Object {
void* _func;
module.symbol ("isatty", out _func);
if (_func == null) {
- return false;
+ module.symbol ("_isatty", out _func);
+ if (_func == null) {
+ return false;
+ }
}
AttyFunc? func = (AttyFunc) _func;
- return func (fd) == 1;
+ return func (fd) > 0;
}
[PrintfFormat]