summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-22 08:50:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-22 08:50:25 +0000
commit5318154fe1ac6f8dff014988488b9e063988a105 (patch)
tree95c52dda086205d9abd64206ebe8a213ac9e1fca /io.c
parentdbd4c4a7b373061d235857f7f34e15859a7f1051 (diff)
eval_error.c: backstrace in reverse order
* eval_error.c (rb_threadptr_error_print): print backtrace and error message in reverse order if STDERR is unchanged and a tty. [Feature #8661] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/io.c b/io.c
index 9bb4570d26..89a8c7ad95 100644
--- a/io.c
+++ b/io.c
@@ -7400,6 +7400,14 @@ rb_write_error_str(VALUE mesg)
}
}
+int
+rb_stderr_tty_p(void)
+{
+ if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0)
+ return isatty(fileno(stderr));
+ return 0;
+}
+
static void
must_respond_to(ID mid, VALUE val, ID id)
{