From bff8ab13f33c59ffed9fcf397a60e26fc376d1ed Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Jun 2008 03:20:36 +0000 Subject: [PATCH] * ext/iconv/iconv.c (iconv_iconv): fixed backport miss. [ruby-core:17115] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 15 +++++---------- ext/iconv/iconv.c | 7 ++++++- version.h | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 192170dca6..124ae3aafd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jun 6 12:20:33 2008 Nobuyoshi Nakada + + * ext/iconv/iconv.c (iconv_iconv): fixed backport miss. + [ruby-core:17115] + Fri Jun 6 00:05:33 2008 Tanaka Akira * lib/time.rb (Time.xmlschema): don't use float. fix @@ -17,16 +22,6 @@ Thu Jun 5 20:30:46 2008 Akinori MUSHA workaround for the case where OpenSSL is configured with --enable-tlsext; submitted by akira yamada in [ruby-dev:34944]. -Thu Jun 5 11:01:08 2008 Nobuyoshi Nakada - - * ext/iconv/iconv.c (iconv_iconv): fixed backport miss. - [ruby-core:17115] - -Thu Jun 5 11:00:48 2008 Nobuyoshi Nakada - - * ext/iconv/iconv.c (iconv_iconv): fixed backport miss. - [ruby-core:17115] - Wed Jun 4 19:36:45 2008 Akinori MUSHA * object.c (rb_obj_alloc): RDoc updated. a patch from Gaston diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 72ecc750f4..d989b97df2 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; + } } } diff --git a/version.h b/version.h index aad9844f74..fab5cec4ce 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.8.7" -#define RUBY_RELEASE_DATE "2008-06-04" +#define RUBY_RELEASE_DATE "2008-06-06" #define RUBY_VERSION_CODE 187 -#define RUBY_RELEASE_CODE 20080604 +#define RUBY_RELEASE_CODE 20080606 #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 6 -#define RUBY_RELEASE_DAY 4 +#define RUBY_RELEASE_DAY 6 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[];