From ea16f7dfc9b6510f46bfe2255f9025ea9dc0aa3d Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 27 May 2008 03:07:55 +0000 Subject: [PATCH] * 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/trunk@16617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ file.c | 8 ++++---- version.h | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47e30f1da1..092bfbf4c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue May 27 12:06:37 2008 NAKAMURA Usaku + + * file.c (BUFCHECK): wrong condition. [ruby-core:16921] + + * file.c (file_expand_buf): shouldn't use buflen for length of string. + Mon May 26 18:24:48 2008 Nobuyoshi Nakada * file.c (BUFCHECK): no resize if enough room. diff --git a/file.c b/file.c index 85152f70b7..0e5e8704dc 100644 --- a/file.c +++ b/file.c @@ -2578,7 +2578,7 @@ ntfs_tail(const char *path) #define BUFCHECK(cond) do {\ long bdiff = p - buf;\ - if (!(cond)) {\ + if (cond) {\ do {buflen *= 2;} while (cond);\ rb_str_resize(result, buflen);\ buf = RSTRING_PTR(result);\ @@ -2827,7 +2827,6 @@ file_expand_path(VALUE fname, VALUE dname, VALUE result) p += s-b; } if (p == skiproot(buf) - 1) p++; - buflen = p - buf; #if USE_NTFS *p = '\0'; @@ -2877,15 +2876,16 @@ file_expand_path(VALUE fname, VALUE dname, VALUE result) } #endif if (!p) p = buf; - ++p; + else ++p; BUFCHECK(bdiff + len >= buflen); memcpy(p, wfd.cFileName, len + 1); + p += len; } } #endif if (tainted) OBJ_TAINT(result); - rb_str_set_len(result, buflen); + rb_str_set_len(result, p - buf); rb_enc_check(fname, result); return result; } diff --git a/version.h b/version.h index 78e362a613..2db5180210 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2008-05-26" +#define RUBY_RELEASE_DATE "2008-05-27" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20080526 +#define RUBY_RELEASE_CODE 20080527 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 5 -#define RUBY_RELEASE_DAY 26 +#define RUBY_RELEASE_DAY 27 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[];