aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
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)
{