summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io.c b/io.c
index 81f1003aa4..d65eff0948 100644
--- a/io.c
+++ b/io.c
@@ -1607,6 +1607,7 @@ rb_io_reopen(io, nfile)
nfile = rb_io_get_io(nfile);
GetOpenFile(nfile, orig);
+ if (fptr == orig) return io;
if (orig->f2) {
fflush(orig->f2);
}
@@ -1999,6 +2000,9 @@ rb_io_stdio_set(val, id, var)
if (TYPE(val) != T_FILE) {
rb_raise(rb_eTypeError, "%s must be IO object", rb_id2name(id));
}
+ if (ruby_verbose) {
+ rb_warn("assignment for %s is done by reopen", rb_id2name(id));
+ }
GetOpenFile(*var, fptr);
fd = fileno(fptr->f);
GetOpenFile(val, fptr);