diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-10 05:22:17 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-10 05:22:17 +0000 |
commit | 10a53d3ef4514b6b50cf716a80981bfa9008f3e1 (patch) | |
tree | 28f8c503efdbf7bfc9a70f33aec63933bbb7c1ac /lib/irb/ruby-lex.rb | |
parent | 9f2937998baf5b90febc01ac7192408a36376d75 (diff) | |
download | ruby-10a53d3ef4514b6b50cf716a80981bfa9008f3e1.tar.gz ruby-10a53d3ef4514b6b50cf716a80981bfa9008f3e1.tar.xz ruby-10a53d3ef4514b6b50cf716a80981bfa9008f3e1.zip |
* lib/irb.rb (IRB::Irb::eval_input): warn and exit if $SAFE >=3
after input evaluation.
* lib/irb.rb (IRB::Irb::eval_input): untaint input string. now
irb works for levels 1 and 2.
* ext/syck/rubyext.c (syck_loader_transfer): should not use
rb_cProc directly, since type_proc may be Proc, Block, or
Method.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/ruby-lex.rb')
-rw-r--r-- | lib/irb/ruby-lex.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 26b0b3b7c..8d5cb4758 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -69,12 +69,12 @@ class RubyLex # io functions def set_input(io, p = nil) @io = io - if p.kind_of?(Proc) + if p.respond_to?(:call) @input = p elsif iterator? - @input = proc + @input = Block.new else - @input = proc{@io.gets} + @input = Block.new{@io.gets} end end @@ -183,11 +183,11 @@ class RubyLex end private :buf_input - def set_prompt(p = proc) - if p.kind_of?(Proc) + def set_prompt(p = Block.new) + if p.respond_to?(:call) @prompt = p else - @prompt = proc{print p} + @prompt = Block.new{print p} end end |