mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (rb_io_mode_enc): encoding spec is not allowed in binary mode.
[ruby-dev:32913] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4f6c04dc52
commit
46933426b0
2 changed files with 8 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Jan 1 17:50:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (rb_io_mode_enc): encoding spec is not allowed in binary mode.
|
||||||
|
[ruby-dev:32913]
|
||||||
|
|
||||||
Tue Jan 1 14:41:56 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Jan 1 14:41:56 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* lib/rexml: 1.9 patch from Sam Ruby mentioned in his blog:
|
* lib/rexml: 1.9 patch from Sam Ruby mentioned in his blog:
|
||||||
|
|
3
io.c
3
io.c
|
@ -3192,6 +3192,9 @@ rb_io_mode_enc(rb_io_t *fptr, const char *mode)
|
||||||
{
|
{
|
||||||
const char *p = strchr(mode, ':');
|
const char *p = strchr(mode, ':');
|
||||||
if (p) {
|
if (p) {
|
||||||
|
if (fptr->mode & FMODE_BINMODE) {
|
||||||
|
rb_raise(rb_eArgError, "encoding in binary mode");
|
||||||
|
}
|
||||||
mode_enc(fptr, p+1);
|
mode_enc(fptr, p+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue