summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-11-07 19:33:41 +0900
committerNobuyoshi Nakada <[email protected]>2024-11-07 19:33:41 +0900
commit1701ddea73cf482289361c7559ad42e2694f65f1 (patch)
treef7026a2715c3f9a53ca3a238905cdfe10762230d /io.c
parentffcfaf4ce4eba4975f6ef79bf4b6c898180107f2 (diff)
[Bug #20802] Copy encodings at reopen as well
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12022
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index 945c5f4fd1..c1cf21adc3 100644
--- a/io.c
+++ b/io.c
@@ -8326,6 +8326,7 @@ io_reopen(VALUE io, VALUE nfile)
/* copy rb_io_t structure */
fptr->mode = orig->mode | (fptr->mode & FMODE_EXTERNAL);
+ fptr->encs = orig->encs;
fptr->pid = orig->pid;
fptr->lineno = orig->lineno;
if (RTEST(orig->pathv)) fptr->pathv = orig->pathv;