* io.c (io_fwrite): freeze converted str.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d1cc0ebb38
commit
72385b042d
@ -1,3 +1,7 @@
|
|||||||
|
Thu Jan 2 16:07:21 2014 Masaki Matsushita <glass.saga@gmail.com>
|
||||||
|
|
||||||
|
* io.c (io_fwrite): freeze converted str.
|
||||||
|
|
||||||
Thu Jan 2 04:15:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Jan 2 04:15:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (rb_longjmp): remove an extra modifier from the forward
|
* eval.c (rb_longjmp): remove an extra modifier from the forward
|
||||||
|
6
io.c
6
io.c
@ -1358,7 +1358,11 @@ io_fwrite(VALUE str, rb_io_t *fptr, int nosync)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
str = do_writeconv(str, fptr, &converted);
|
str = do_writeconv(str, fptr, &converted);
|
||||||
if (!converted) str = rb_str_new_frozen(str);
|
if (converted)
|
||||||
|
OBJ_FREEZE(str);
|
||||||
|
else
|
||||||
|
str = rb_str_new_frozen(str);
|
||||||
|
|
||||||
return io_binwrite(str, RSTRING_PTR(str), RSTRING_LEN(str),
|
return io_binwrite(str, RSTRING_PTR(str), RSTRING_LEN(str),
|
||||||
fptr, nosync);
|
fptr, nosync);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user