diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-01 05:32:29 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-01 05:32:29 +0000 |
commit | c88c7d911f215ef581d0292e93bc38a11e9b7cd1 (patch) | |
tree | 10d3af1aededf06e3822cfb5babc3473b8afda32 /io.c | |
parent | 9ffa42b995bc1ef9c2b763453f29d42a59755426 (diff) |
bold/underscore support in traceback before Windows10
* io.c (rb_write_error2): call `rb_w32_write_console()` when the device is tty,
like `rb_write_error_str()`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -7767,6 +7767,11 @@ void rb_write_error2(const char *mesg, long len) { if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) { +#ifdef _WIN32 + if (isatty(fileno(stderr))) { + if (rb_w32_write_console(rb_str_new(mesg, len), fileno(stderr)) > 0) return; + } +#endif if (fwrite(mesg, sizeof(char), (size_t)len, stderr) < (size_t)len) { /* failed to write to stderr, what can we do? */ return; |