From 08659c209c1947263b9b5b840d47bf1d032a8e81 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 1 Sep 2006 00:37:09 +0000 Subject: * lib/irb/ruby-lex.rb (RubyLex::getc): should not push nil into reading buffer (@readed). reported in . git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/occur.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample/occur.rb b/sample/occur.rb index 8bb09e15a..4ec6ae479 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 -- cgit