summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io.c b/io.c
index f7aec96660..8d2f8e088a 100644
--- a/io.c
+++ b/io.c
@@ -4642,10 +4642,12 @@ rb_obj_display(int argc, VALUE *argv, VALUE self)
{
VALUE out;
- if (rb_scan_args(argc, argv, "01", &out) == 0) {
+ if (argc == 0) {
out = rb_stdout;
}
-
+ else {
+ rb_scan_args(argc, argv, "01", &out);
+ }
rb_io_write(out, self);
return Qnil;