* eval.c (ruby_init): set ruby_running to true after

initialization.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-07-17 05:23:54 +00:00
parent 06f82d3883
commit 46bf621737
6 changed files with 31 additions and 14 deletions

View File

@ -1,3 +1,8 @@
Thu Jul 17 13:46:25 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (ruby_init): set ruby_running to true after
initialization.
Thu Jul 17 13:42:53 2003 WATANABE Hirofumi <eban@ruby-lang.org> Thu Jul 17 13:42:53 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* lib/ftools.rb (File::makedirs): do not handle "//" as a directory. * lib/ftools.rb (File::makedirs): do not handle "//" as a directory.

3
eval.c
View File

@ -365,7 +365,6 @@ rb_get_method_body(klassp, idp, noexp)
if (ruby_running) { if (ruby_running) {
/* store in cache */ /* store in cache */
if (BUILTIN_TYPE(origin) == T_ICLASS) origin = RBASIC(origin)->klass;
ent = cache + EXPR1(klass, id); ent = cache + EXPR1(klass, id);
ent->klass = klass; ent->klass = klass;
ent->noex = body->nd_noex; ent->noex = body->nd_noex;
@ -1200,6 +1199,7 @@ ruby_init()
} }
POP_SCOPE(); POP_SCOPE();
ruby_scope = top_scope; ruby_scope = top_scope;
ruby_running = 1;
} }
static VALUE static VALUE
@ -1365,7 +1365,6 @@ ruby_exec()
volatile NODE *tmp; volatile NODE *tmp;
Init_stack((void*)&tmp); Init_stack((void*)&tmp);
ruby_running = 1;
PUSH_TAG(PROT_NONE); PUSH_TAG(PROT_NONE);
PUSH_ITER(ITER_NOT); PUSH_ITER(ITER_NOT);
/* default visibility is private at toplevel */ /* default visibility is private at toplevel */

View File

@ -324,7 +324,7 @@ module TkComm
return '' if cmd == '' return '' if cmd == ''
id = _next_cmd_id id = _next_cmd_id
Tk_CMDTBL[id] = cmd Tk_CMDTBL[id] = cmd
@cmdtbl = [] unless @cmdtbl @cmdtbl = [] unless defined? @cmdtbl
@cmdtbl.push id @cmdtbl.push id
return format("rb_out %s", id); return format("rb_out %s", id);
end end
@ -859,10 +859,6 @@ module TkCore
tk_call 'tk_getSaveFile', *hash_kv(keys) tk_call 'tk_getSaveFile', *hash_kv(keys)
end end
def chooseDirectory(keys = nil)
tk_call 'tk_chooseDIrectory', *hash_kv(keys)
end
def chooseColor(keys = nil) def chooseColor(keys = nil)
tk_call 'tk_chooseColor', *hash_kv(keys) tk_call 'tk_chooseColor', *hash_kv(keys)
end end
@ -1385,7 +1381,7 @@ if /^8\.[1-9]/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK
attr_accessor :encoding attr_accessor :encoding
def _eval(cmd) def _eval(cmd)
if @encoding if defined? @encoding
_fromUTF8(__eval(_toUTF8(cmd, @encoding)), @encoding) _fromUTF8(__eval(_toUTF8(cmd, @encoding)), @encoding)
else else
__eval(cmd) __eval(cmd)
@ -1393,7 +1389,7 @@ if /^8\.[1-9]/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK
end end
def _invoke(*cmds) def _invoke(*cmds)
if @encoding if defined? @encoding
cmds = cmds.collect{|cmd| _toUTF8(cmd, @encoding)} cmds = cmds.collect{|cmd| _toUTF8(cmd, @encoding)}
_fromUTF8(__invoke(*cmds), @encoding) _fromUTF8(__invoke(*cmds), @encoding)
else else
@ -1505,8 +1501,6 @@ class TkBindTag
} }
end end
ALL = self.new_by_name('all')
def initialize(*args, &b) def initialize(*args, &b)
@id = Tk_BINDTAG_ID[0] @id = Tk_BINDTAG_ID[0]
Tk_BINDTAG_ID[0] = Tk_BINDTAG_ID[0].succ Tk_BINDTAG_ID[0] = Tk_BINDTAG_ID[0].succ
@ -1514,6 +1508,8 @@ class TkBindTag
bind(*args, &b) if args != [] bind(*args, &b) if args != []
end end
ALL = self.new_by_name('all')
def name def name
@id @id
end end

1
gc.c
View File

@ -1109,6 +1109,7 @@ obj_free(obj)
} }
break; break;
case T_ICLASS: case T_ICLASS:
rb_clear_cache_by_class((VALUE)obj);
/* iClass shares table with the module */ /* iClass shares table with the module */
break; break;

View File

@ -18,11 +18,11 @@ rescue LoadError
module REXML module REXML
module Encoding module Encoding
def from_euc_jp(str) def from_euc_jp(str)
return Iconv::iconv("utf-8", "euc-jp", str).join return Iconv::iconv("utf-8", "euc-jp", str).join('')
end end
def to_euc_jp content def to_euc_jp content
return Iconv::iconv("euc-jp", "utf-8", content).join return Iconv::iconv("euc-jp", "utf-8", content).join('')
end end
end end
end end

View File

@ -13,5 +13,21 @@ begin
end end
end end
rescue LoadError rescue LoadError
raise "uconv is required for Japanese encoding support." begin
require 'iconv'
module REXML
module Encoding
def from_shift_jis(str)
return Iconv::iconv("utf-8", "shift_jis", str).join('')
end
def to_shift_jis content
return Iconv::iconv("shift_jis", "utf-8", content).join('')
end
end
end
rescue LoadError
raise "uconv or iconv is required for Japanese encoding support."
end
end end