aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--io.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c60c1f285..981afba581 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/io.c b/io.c
index cb1997a486..21d6d12c9c 100644
--- a/io.c
+++ b/io.c
@@ -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);
}