summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/iconv/iconv.c7
-rw-r--r--version.h8
3 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a4026777a..91020d2d33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;
+ }
}
}
diff --git a/version.h b/version.h
index 48751f2075..5d087ab536 100644
--- a/version.h
+++ b/version.h
@@ -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[];