summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 14:25:44 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 14:25:44 (GMT)
commitc519f1b74c4cfe043726e30a72b0ea77f8b230eb (patch)
treed2f62ee0315ad7e366bda6049553b1459f40e4b2
parente9f900761e71d657abea5f4620f42a5eaa3c2055 (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--ChangeLog6
-rw-r--r--file.c14
-rw-r--r--version.h2
3 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index c16d1f9..67e3184 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/file.c b/file.c
index 3a6295d..11ae04f 100644
--- a/file.c
+++ b/file.c
@@ -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;
}
diff --git a/version.h b/version.h
index 7933e15..f7e5bcb 100644
--- a/version.h
+++ b/version.h
@@ -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