From 1294ea9a9b2a07451f0474bb3b7a20d9210286da Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 7 Oct 2004 04:06:41 +0000 Subject: * pack.c (pack_unpack): string conversion should at the top of the method. [ruby-dev:24439] * io.c (io_read): buffer should be frozen only after the length check. [ruby-dev:24440] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ array.c | 2 ++ io.c | 2 +- pack.c | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff58c5a6e..0085a8dd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Oct 7 12:55:04 2004 Yukihiro Matsumoto + + * pack.c (pack_unpack): string conversion should at the top of the + method. [ruby-dev:24439] + + * io.c (io_read): buffer should be frozen only after the length + check. [ruby-dev:24440] + Thu Oct 7 02:56:43 2004 Nobuyoshi Nakada * ext/stringio/stringio.c: use FMODE_APPEND. diff --git a/array.c b/array.c index 7afc1301b..3fe872b85 100644 --- a/array.c +++ b/array.c @@ -1572,6 +1572,7 @@ sort_1(a, b, data) int n; n = rb_cmpint(retval, *a, *b); + ary_sort_check(data); return n; } @@ -1595,6 +1596,7 @@ sort_2(ap, bp, data) retval = rb_funcall(a, id_cmp, 1, b); n = rb_cmpint(retval, a, b); + ary_sort_check(data); return n; } diff --git a/io.c b/io.c index 76578529c..ffff98f9e 100644 --- a/io.c +++ b/io.c @@ -1067,11 +1067,11 @@ io_read(argc, argv, io) StringValue(str); rb_str_modify(str); rb_str_resize(str,len); - FL_SET(str, FL_FREEZE); } if (len == 0) return str; READ_CHECK(fptr->f); + FL_SET(str, FL_FREEZE); n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f); FL_UNSET(str, FL_FREEZE); if (n == 0) { diff --git a/pack.c b/pack.c index baff504be..a435e130b 100644 --- a/pack.c +++ b/pack.c @@ -1377,9 +1377,9 @@ pack_unpack(str, fmt) #endif StringValue(str); + StringValue(fmt); s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; - StringValue(fmt); p = RSTRING(fmt)->ptr; pend = p + RSTRING(fmt)->len; -- cgit