ruby-changes:25161
From: nobu <ko1@a...>
Date: Tue, 16 Oct 2012 11:30:32 +0900 (JST)
Subject: [ruby-changes:25161] nobu:r37213 (trunk): file.c: hide result
nobu 2012-10-16 11:30:20 +0900 (Tue, 16 Oct 2012) New Revision: 37213 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37213 Log: file.c: hide result * file.c (rb_file_join): hide the result under construction until return. Modified files: trunk/ChangeLog trunk/file.c Index: ChangeLog =================================================================== --- ChangeLog (revision 37212) +++ ChangeLog (revision 37213) @@ -1,5 +1,8 @@ -Tue Oct 16 11:27:04 2012 Nobuyoshi Nakada <nobu@r...> +Tue Oct 16 11:30:18 2012 Nobuyoshi Nakada <nobu@r...> + * file.c (rb_file_join): hide the result under construction until + return. + * file.c (rb_file_join): check nul-byte only for strings, since FilePathStringValue() does it. [ruby-core:48012] [Bug #7168] Index: file.c =================================================================== --- file.c (revision 37212) +++ file.c (revision 37213) @@ -3936,6 +3936,7 @@ len += RSTRING_LEN(sep) * (RARRAY_LEN(ary) - 1); } result = rb_str_buf_new(len); + RBASIC(result)->klass = 0; OBJ_INFECT(result, ary); for (i=0; i<RARRAY_LEN(ary); i++) { tmp = RARRAY_PTR(ary)[i]; @@ -3973,6 +3974,7 @@ } rb_str_buf_append(result, tmp); } + RBASIC(result)->klass = rb_cString; return result; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/