From f923cc360ae0e496da656a4253bc38fba12eed5d Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 25 Jan 2008 16:37:53 +0000 Subject: * marshal.c (r_byte): use getbyte instead of getc. (marshal_load): ditto. [ruby-dev:33264] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ marshal.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 166d7a03fb..911638a6e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Jan 26 01:35:46 2008 Tanaka Akira + + * marshal.c (r_byte): use getbyte instead of getc. + (marshal_load): ditto. + [ruby-dev:33264] + Sat Jan 26 00:43:40 2008 Tanaka Akira * io.c (rb_io_getline_fast): don't care ASCII incompatible encoding. diff --git a/marshal.c b/marshal.c index 29f26d0b2f..fe7d11cc3e 100644 --- a/marshal.c +++ b/marshal.c @@ -80,7 +80,7 @@ shortlen(long len, BDIGIT *ds) static ID s_dump, s_load, s_mdump, s_mload; static ID s_dump_data, s_load_data, s_alloc; -static ID s_getc, s_read, s_write, s_binmode; +static ID s_getbyte, s_read, s_write, s_binmode; ID rb_id_encoding(void); @@ -903,7 +903,7 @@ r_byte(struct load_arg *arg) } else { VALUE src = arg->src; - VALUE v = rb_funcall2(src, s_getc, 0, 0); + VALUE v = rb_funcall2(src, s_getbyte, 0, 0); if (NIL_P(v)) rb_eof_error(); c = (unsigned char)NUM2CHR(v); } @@ -1556,7 +1556,7 @@ marshal_load(int argc, VALUE *argv) arg.taint = OBJ_TAINTED(port); /* original taintedness */ StringValue(port); /* possible conversion */ } - else if (rb_respond_to(port, s_getc) && rb_respond_to(port, s_read)) { + else if (rb_respond_to(port, s_getbyte) && rb_respond_to(port, s_read)) { if (rb_respond_to(port, s_binmode)) { rb_funcall2(port, s_binmode, 0, 0); } @@ -1637,7 +1637,7 @@ Init_marshal(void) s_dump_data = rb_intern("_dump_data"); s_load_data = rb_intern("_load_data"); s_alloc = rb_intern("_alloc"); - s_getc = rb_intern("getc"); + s_getbyte = rb_intern("getbyte"); s_read = rb_intern("read"); s_write = rb_intern("write"); s_binmode = rb_intern("binmode"); -- cgit v1.2.3