summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/jcode.rb7
-rw-r--r--string.c2
3 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d96c8e5169f..e1f046a5244 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jul 7 17:49:16 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_ord): extract lower byte. fixed: [ruby-dev:28980]
+
+ * lib/jcode.rb (String#succ!): fix for 1.9. fixed: [ruby-dev:28979]
+
Fri Jul 7 14:05:03 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/Makefile.sub (config.h): define FUNC_STDCALL/FUNC_CDECL.
diff --git a/lib/jcode.rb b/lib/jcode.rb
index fcf4f047309..6b123a839b6 100644
--- a/lib/jcode.rb
+++ b/lib/jcode.rb
@@ -79,9 +79,12 @@ class String
reg = end_regexp
if self =~ reg
succ_table = SUCC[$KCODE[0,1].downcase]
+ last1 = self[-1].ord
+ last2 = self[-2].ord
begin
- self[-1] += succ_table[self[-1]]
- self[-2] += 1 if self[-1] == 0
+ last1 += succ_table[last1]
+ last2 += 1 if last1 == 0
+ self[-2..-1] = [last2, last1].pack("C*")
end while self !~ reg
self
else
diff --git a/string.c b/string.c
index d5112970890..bcd75a229af 100644
--- a/string.c
+++ b/string.c
@@ -4070,7 +4070,7 @@ rb_str_ord(VALUE s)
"expacted a characer, but string of size %d given",
RSTRING(s)->len);
}
- c = RSTRING(s)->ptr[0];
+ c = RSTRING(s)->ptr[0] & 0xff;
return INT2NUM(c);
}
/*