summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-04-24 23:09:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-04-24 23:09:01 +0000
commita1157429688ec922f97963db99bc5913b39a5972 (patch)
treecf45ac0087a4a980292ac385c91c2c216f8d88e6 /lib
parent870eb33e6b65b877638168dbc9b84b8367fff7ee (diff)
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/jcode.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/jcode.rb b/lib/jcode.rb
index 691d22dafe..e5367e815b 100644
--- a/lib/jcode.rb
+++ b/lib/jcode.rb
@@ -175,7 +175,7 @@ class String
def tr_s!(from, to)
return self.delete!(from) if to.length == 0
- pattern = SqueezePatternCache[from] ||= /([#{_regex_quote(from)}])\1+/
+ pattern = SqueezePatternCache[from] ||= /([#{_regex_quote(from)}])\1*/
if from[0] == ?^
last = /.$/.match(to)[0]
self.gsub!(pattern, last)