diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 14:25:44 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 14:25:44 +0000 |
commit | c519f1b74c4cfe043726e30a72b0ea77f8b230eb (patch) | |
tree | d2f62ee0315ad7e366bda6049553b1459f40e4b2 | |
parent | e9f900761e71d657abea5f4620f42a5eaa3c2055 (diff) |
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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | file.c | 14 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 16 insertions, 6 deletions
@@ -1,3 +1,9 @@ +Sun Jun 15 23:24:32 2008 NAKAMURA Usaku <usa@ruby-lang.org> + + * 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:21:22 2008 Akinori MUSHA <knu@iDaemons.org> * marshal.c (r_object0, Init_marshal): Fix the garbled s_call @@ -2509,8 +2509,12 @@ ntfs_tail(const char *path) #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;\ @@ -2751,7 +2755,6 @@ file_expand_path(fname, dname, result) p += s-b; } if (p == skiproot(buf) - 1) p++; - buflen = p - buf; #if USE_NTFS *p = '\0'; @@ -2800,13 +2803,14 @@ file_expand_path(fname, dname, result) 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; } @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2008-06-15" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20080615 -#define RUBY_PATCHLEVEL 217 +#define RUBY_PATCHLEVEL 218 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 |