From 9a7a9e28913bdb2097ec89a646a092ee8196179d Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 22 Feb 2017 08:50:25 +0000 Subject: 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 --- io.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'io.c') 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) { -- cgit v1.2.3