diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-30 03:56:28 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-30 03:56:28 +0000 |
commit | 4078d42b72339cd80a88a1d2aa163b5499e2f5f7 (patch) | |
tree | b0b1754421119ce0955de44c72d4d8fb2596b039 /lib/abbrev.rb | |
parent | aac52e2b87389aa41013e6fd7f26d119de10c209 (diff) |
Fix a line matching problem in Abbrev.abbrev(words, "prefix").
* lib/abbrev.rb (Abbrev#abbrev): A fixed string prefix pattern
should only match the beginning of each word, not the beginning
of every line in it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/abbrev.rb')
-rw-r--r-- | lib/abbrev.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/abbrev.rb b/lib/abbrev.rb index 1aae0e1fcf..443ab6d8f1 100644 --- a/lib/abbrev.rb +++ b/lib/abbrev.rb @@ -69,7 +69,7 @@ module Abbrev seen = Hash.new(0) if pattern.is_a?(String) - pattern = /^#{Regexp.quote(pattern)}/ # regard as a prefix + pattern = /\A#{Regexp.quote(pattern)}/ # regard as a prefix end words.each do |word| |