1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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@16618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2008-05-27 03:13:29 +00:00
parent 95423b857d
commit cb49b26e7c
3 changed files with 12 additions and 6 deletions

View file

@ -1,3 +1,9 @@
Tue May 27 12:13:17 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.
Mon May 26 18:24:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (BUFCHECK): no resize if enough room.

6
file.c
View file

@ -2497,7 +2497,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);\
@ -2739,7 +2739,6 @@ file_expand_path(fname, dname, result)
p += s-b;
}
if (p == skiproot(buf) - 1) p++;
buflen = p - buf;
#if USE_NTFS
*p = '\0';
@ -2792,12 +2791,13 @@ file_expand_path(fname, dname, result)
++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);
return result;
}

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.8.7"
#define RUBY_RELEASE_DATE "2008-05-26"
#define RUBY_RELEASE_DATE "2008-05-27"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20080526
#define RUBY_RELEASE_CODE 20080527
#define RUBY_PATCHLEVEL 5000
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 7
#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[];