1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* io.c (rb_io_ungetc): always see Bignum. On 32bit valid value

may be a Bignum. On 64bit for errors. [ruby-dev:42366]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-10-12 09:30:42 +00:00
parent 1e22306569
commit b487f7881f
2 changed files with 5 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Tue Oct 12 18:25:43 2010 NARUSE, Yui <naruse@ruby-lang.org>
* io.c (rb_io_ungetc): always see Bignum. On 32bit valid value
may be a Bignum. On 64bit for errors. [ruby-dev:42366]
Tue Oct 12 18:25:04 2010 NARUSE, Yui <naruse@ruby-lang.org>
* string.c (rb_str_concat): use unsigned int for GB18030.

2
io.c
View file

@ -3231,11 +3231,9 @@ rb_io_ungetc(VALUE io, VALUE c)
if (FIXNUM_P(c)) {
c = rb_enc_uint_chr(FIX2UINT(c), io_read_encoding(fptr));
}
#if SIZEOF_LONG > SIZEOF_INT
else if (TYPE(c) == T_BIGNUM) {
c = rb_enc_uint_chr(NUM2UINT(c), io_read_encoding(fptr));
}
#endif
else {
SafeStringValue(c);
}