X-Git-Url: http://git.code-monkey.de/?p=ruby-eet.git;a=blobdiff_plain;f=ext%2Fext.c;h=a9f14db9fbc4fd279443949a7cc52d045cdd0c8c;hp=e36442f9501e5025132db4e71bf8a282017773f5;hb=1904581b325c485e96a25b43ca7bfbabe48b4c03;hpb=b0bad9534611464914a7d7f5563b515e180e1f20 diff --git a/ext/ext.c b/ext/ext.c index e36442f..a9f14db 100644 --- a/ext/ext.c +++ b/ext/ext.c @@ -1,5 +1,5 @@ /* - * $Id: ext.c 63 2005-06-09 17:47:46Z tilman $ + * $Id: ext.c 64 2005-06-27 19:22:58Z tilman $ * * Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) * @@ -444,11 +444,11 @@ stream_serialize (VALUE self) struct RArray *stream; long i; - ret = rb_str_new2 (""); - stream = RARRAY (self); if (!stream->len) - return ret; + return rb_str_new2 (""); + + ret = rb_ary_new (); for (i = 0; i < stream->len; i++) { VALUE str; @@ -458,10 +458,10 @@ stream_serialize (VALUE self) str = rb_funcall (stream->ptr[i], id_serialize, 0, NULL); - rb_str_append (ret, str); + rb_ary_push (ret, str); } - return ret; + return rb_ary_join (ret, Qnil); } static VALUE