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

* 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]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2006-07-07 08:49:34 +00:00
parent 9dc29ddfd7
commit 0fbcc455bd
3 changed files with 12 additions and 3 deletions

View file

@ -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