diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-28 08:42:40 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-28 08:42:40 +0000 |
commit | c9cf552a91f7248b73e2e7cab5b423861176a95c (patch) | |
tree | 8dc3e9ac704d3f5789f5547d0de557712d390b36 /ext | |
parent | 5f12cd3e24538d79581e6572badcca1a6d3ae95e (diff) |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/pty/pty.c | 2 | ||||
-rw-r--r-- | ext/tk/lib/tk.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tkfont.rb | 4 | ||||
-rw-r--r-- | ext/tk/lib/tktext.rb | 16 |
4 files changed, 17 insertions, 9 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c index 15f3b5caa8..5adb0992e0 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -452,7 +452,7 @@ pty_getpty(self, command) rfptr->f = fdopen(info.fd, "r"); rfptr->path = strdup(RSTRING(command)->ptr); - 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(RSTRING(command)->ptr); diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 681b673ff8..144569b339 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -1317,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 @@ -1351,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 c44b215ee9..c1e45cbe54 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 6ec738edb0..f7d93618f9 100644 --- a/ext/tk/lib/tktext.rb +++ b/ext/tk/lib/tktext.rb @@ -813,12 +813,20 @@ class TkTextMark<TkObject tk_call @t.path, 'mark', 'gravity', @id, direction end - def next(index) - @t.tagid2obj(tk_call(@t.path, 'mark', 'next', index)) + def next(index = nil) + if index + @t.tagid2obj(tk_call(@t.path, 'mark', 'next', index)) + else + @t.tagid2obj(tk_call(@t.path, 'mark', 'next', @id)) + end end - def previous(index) - @t.tagid2obj(tk_call(@t.path, 'mark', 'previous', index)) + def previous(index = nil) + if index + @t.tagid2obj(tk_call(@t.path, 'mark', 'previous', index)) + else + @t.tagid2obj(tk_call(@t.path, 'mark', 'previous', @id)) + end end end |