From 5a928a5496897d334534b7e025a5e41c9170aedd Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 28 Jan 2002 08:44:45 +0000 Subject: * eval.c (is_defined): defined?(Foo::Baz) should check constants only, no methods. * eval.c (is_defined): should not dump core on defined?(a::b) where a is not a class nor a module. * object.c (Init_Object): remove dup and clone from TrueClass, FalseClass, and NilClass. * array.c (rb_ary_fill): Array#fill takes block to get the value to fill. * string.c (rb_str_to_i): to_i(0) auto-detects base radix. * array.c (rb_ary_initialize): fill by the block evaluation value if block is given. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/pty/pty.c | 2 +- ext/tk/lib/tk.rb | 5 ++--- ext/tk/lib/tkfont.rb | 4 ++-- ext/tk/lib/tktext.rb | 16 ++++++++++++---- 4 files changed, 17 insertions(+), 10 deletions(-) (limited to 'ext') diff --git a/ext/pty/pty.c b/ext/pty/pty.c index def44b6f4..b7c69fe40 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -433,7 +433,7 @@ pty_getpty(argc, argv, self) rfptr->f = fdopen(info.fd, "r"); rfptr->path = strdup(SlaveName); - wfptr->mode = rb_io_mode_flags("w"); + wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC; wfptr->f = fdopen(dup(info.fd), "w"); wfptr->path = strdup(SlaveName); diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 26b3dca03..066864a23 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -93,7 +93,6 @@ module TkComm brace -= 1 if c == ?} break if brace == 0 } - p str[0,i] if str[0, i] == ' ' list.push ' ' else @@ -1318,7 +1317,7 @@ class TkVariable opts = ['r','w','u'].find_all{|c| opts.index(c)}.join('') idx = -1 newopts = '' - @trace_var.each_with_index{|i,e| + @trace_var.each_with_index{|e,i| if idx < 0 && e[0] == opts && e[1] == cmd idx = i next @@ -1352,7 +1351,7 @@ class TkVariable return unless @trace_elem[elem].kind_of? Array opts = ['r','w','u'].find_all{|c| opts.index(c)}.join('') idx = -1 - @trace_elem[elem].each_with_index{|i,e| + @trace_elem[elem].each_with_index{|e,i| if idx < 0 && e[0] == opts && e[1] == cmd idx = i next diff --git a/ext/tk/lib/tkfont.rb b/ext/tk/lib/tkfont.rb index c44b215ee..c1e45cbe5 100644 --- a/ext/tk/lib/tkfont.rb +++ b/ext/tk/lib/tkfont.rb @@ -173,8 +173,8 @@ class TkFont TkFont.new(nil, nil).call_font_configure(path, *(args + [{}])) else begin - compound = Hash[*list(tk_call('font', 'configure', - fnt))].collect{|key,value| + compound = Hash[*tk_split_simplelist(tk_call('font', 'configure', + fnt))].collect{|key,value| [key[1..-1], value] }.assoc('compound')[1] rescue diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb index 6ec738edb..f7d93618f 100644 --- a/ext/tk/lib/tktext.rb +++ b/ext/tk/lib/tktext.rb @@ -813,12 +813,20 @@ class TkTextMark