ruby-changes:5827
From: shyouhei <ko1@a...>
Date: Sun, 15 Jun 2008 23:24:46 +0900 (JST)
Subject: [ruby-changes:5827] Ruby:r17333 (ruby_1_8_5): merge revision(s) 16618:
shyouhei 2008-06-15 23:24:09 +0900 (Sun, 15 Jun 2008) New Revision: 17333 Modified files: branches/ruby_1_8_5/ChangeLog branches/ruby_1_8_5/file.c branches/ruby_1_8_5/version.h Log: merge revision(s) 16618: * file.c (BUFCHECK): wrong condition. [ruby-core:16921] * file.c (file_expand_buf): shouldn't use buflen for length of string. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/version.h?r1=17333&r2=17332&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/ChangeLog?r1=17333&r2=17332&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_5/file.c?r1=17333&r2=17332&diff_format=u Index: ruby_1_8_5/ChangeLog =================================================================== --- ruby_1_8_5/ChangeLog (revision 17332) +++ ruby_1_8_5/ChangeLog (revision 17333) @@ -1,3 +1,9 @@ +Sun Jun 15 23:21:48 2008 NAKAMURA Usaku <usa@r...> + + * file.c (BUFCHECK): wrong condition. [ruby-core:16921] + + * file.c (file_expand_buf): shouldn't use buflen for length of string. + Sun Jun 15 23:20:37 2008 Akinori MUSHA <knu@i...> * marshal.c (r_object0, Init_marshal): Fix the garbled s_call Index: ruby_1_8_5/version.h =================================================================== --- ruby_1_8_5/version.h (revision 17332) +++ ruby_1_8_5/version.h (revision 17333) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2008-06-15" #define RUBY_VERSION_CODE 185 #define RUBY_RELEASE_CODE 20080615 -#define RUBY_PATCHLEVEL 216 +#define RUBY_PATCHLEVEL 217 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 Index: ruby_1_8_5/file.c =================================================================== --- ruby_1_8_5/file.c (revision 17332) +++ ruby_1_8_5/file.c (revision 17333) @@ -2520,8 +2520,12 @@ #define BUFCHECK(cond) do {\ long bdiff = p - buf;\ - while (cond) {\ - buflen *= 2;\ + if (cond) {\ + do {buflen *= 2;} while (cond);\ + rb_str_resize(result, buflen);\ + buf = RSTRING(result)->ptr;\ + p = buf + bdiff;\ + pend = buf + buflen;\ }\ rb_str_resize(result, buflen);\ buf = RSTRING(result)->ptr;\ @@ -2762,7 +2766,6 @@ p += s-b; } if (p == skiproot(buf) - 1) p++; - buflen = p - buf; #if USE_NTFS *p = '\0'; @@ -2811,13 +2814,14 @@ buflen = ++p - buf + len; rb_str_resize(result, buflen); memcpy(p, wfd.cFileName, len + 1); + p += len; } } #endif if (tainted) OBJ_TAINT(result); - RSTRING(result)->len = buflen; - RSTRING(result)->ptr[buflen] = '\0'; + RSTRING(result)->len = p - buf; + RSTRING(result)->ptr[p - buf] = '\0'; return result; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/