diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/iconv/iconv.c | 7 | ||||
-rw-r--r-- | version.h | 8 |
3 files changed, 15 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Wed Jul 2 17:38:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ext/iconv/iconv.c (iconv_iconv): fixed backport miss. + [ruby-core:17115] + Tue Jul 1 15:09:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * array.c (rb_ary_fill): check if beg is too big. diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 4736cb1008..4674aa330e 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -755,7 +755,12 @@ iconv_iconv if (!NIL_P(str)) slen = RSTRING_LEN(StringValue(str)); if (argc != 2 || !RTEST(rb_range_beg_len(n1, &start, &length, slen, 0))) { if (NIL_P(n1) || ((start = NUM2LONG(n1)) < 0 ? (start += slen) >= 0 : start < slen)) { - if (!NIL_P(n2)) length = NUM2LONG(n2); + if (NIL_P(n2)) { + length = -1; + } + else if ((length = NUM2LONG(n2)) >= slen - start) { + length = slen - start; + } } } @@ -1,15 +1,15 @@ #define RUBY_VERSION "1.8.6" -#define RUBY_RELEASE_DATE "2008-07-01" +#define RUBY_RELEASE_DATE "2008-07-02" #define RUBY_VERSION_CODE 186 -#define RUBY_RELEASE_CODE 20080701 -#define RUBY_PATCHLEVEL 257 +#define RUBY_RELEASE_CODE 20080702 +#define RUBY_PATCHLEVEL 258 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_TEENY 6 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 7 -#define RUBY_RELEASE_DAY 1 +#define RUBY_RELEASE_DAY 2 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; |