diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-01 00:37:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-01 00:37:09 +0000 |
commit | 6a640106d2158cf8369f4ce77c50444ca09b76b2 (patch) | |
tree | 8b7d7b4c9eff5188280b5b045a7d9de8a0c2ca5b /sample/occur.rb | |
parent | 079ec46b4b2994100466d4cfb191918255880ef3 (diff) | |
download | ruby-6a640106d2158cf8369f4ce77c50444ca09b76b2.tar.gz |
* lib/irb/ruby-lex.rb (RubyLex::getc): should not push nil into
reading buffer (@readed). reported in
<http://jarp.does.notwork.org/diary/200608c.html#200608311>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/occur.rb')
-rw-r--r-- | sample/occur.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sample/occur.rb b/sample/occur.rb index 8bb09e15ad..4ec6ae479b 100644 --- a/sample/occur.rb +++ b/sample/occur.rb @@ -1,8 +1,8 @@ # word occurrence listing # usege: ruby occur.rb file.. freq = Hash.new(0) -while gets() - for word in split(/\W+/) +while line = gets() + for word in line.split(/\W+/) freq[word] += 1 end end |