summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-01 00:37:09 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-01 00:37:09 +0000
commit08659c209c1947263b9b5b840d47bf1d032a8e81 (patch)
tree8b7d7b4c9eff5188280b5b045a7d9de8a0c2ca5b
parent895517b5362fe0d8626df76f10819364be20bc32 (diff)
downloadruby-08659c209c1947263b9b5b840d47bf1d032a8e81.tar.gz
ruby-08659c209c1947263b9b5b840d47bf1d032a8e81.tar.xz
ruby-08659c209c1947263b9b5b840d47bf1d032a8e81.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@10815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--sample/occur.rb4
1 files 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