Skip to content

Commit 62da8d9

Browse files
author
matz
committed
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 223327a commit 62da8d9

File tree

8 files changed

+309
-154
lines changed

8 files changed

+309
-154
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
Mon Aug 7 13:59:12 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
2+
3+
* regex.c (re_match): check for stack depth was needed.
4+
15
Sat Aug 5 16:43:43 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
26

37
* lib/ftools.rb (compare, safe_unlink, chmod): avoid warnings.
48

59
* lib/ftools.rb (move): typo. not `tpath', but `to'.
610

11+
Wed Aug 2 18:27:47 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
12+
13+
* eval.c (rb_continuation_call): prohibit Continuation#call across
14+
threads.
15+
716
Sat Jul 29 23:42:04 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
817

918
* dir.c (dir_each): should check whether dir is closed during the

configure

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ else
515515
> $cache_file
516516
fi
517517

518-
echo $CC
519518
ac_ext=c
520519
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
521520
ac_cpp='$CPP $CPPFLAGS'
@@ -4692,9 +4691,12 @@ case "$host_os" in
46924691
openstep*)
46934692
CFLAGS="$CFLAGS -pipe"
46944693
;;
4695-
rhasody*)
4694+
rhapsody*)
46964695
CFLAGS="$CFLAGS -pipe -no-precomp"
46974696
;;
4697+
os2_emx)
4698+
CFLAGS="$CFLAGS -DOS2"
4699+
;;
46984700
*)
46994701
;;
47004702
esac

eval.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7518,7 +7518,8 @@ rb_callcc(self)
75187518
for (tag=prot_tag; tag; tag=tag->prev) {
75197519
scope_dup(tag->scope);
75207520
}
7521-
th->prev = th->next = 0;
7521+
th->prev = 0;
7522+
th->next = curr_thread;
75227523
if (THREAD_SAVE_CONTEXT(th)) {
75237524
return th->result;
75247525
}
@@ -7535,6 +7536,9 @@ rb_continuation_call(argc, argv, cont)
75357536
{
75367537
rb_thread_t th = rb_thread_check(cont);
75377538

7539+
if (th->next != curr_thread) {
7540+
rb_raise(rb_eRuntimeError, "continuation called across threads");
7541+
}
75387542
switch (argc) {
75397543
case 0:
75407544
th->result = Qnil;

ext/tk/lib/tk.rb

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def initialize(seq,b,f,h,k,s,t,w,x,y,aa,ee,kk,nn,ww,tt,xx,yy)
311311

312312
def install_bind(cmd, args=nil)
313313
if args
314-
id = install_cmd(proc{|arg|
314+
id = install_cmd(proc{|*arg|
315315
TkUtil.eval_cmd cmd, *arg
316316
})
317317
id + " " + args
@@ -784,6 +784,96 @@ def withdraw
784784
end
785785
end
786786

787+
###########################################
788+
# convert kanji string to/from utf-8
789+
###########################################
790+
if /^8\.[1-9]/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK
791+
class TclTkIp
792+
# from tkencoding.rb by ttate@jaist.ac.jp
793+
alias __eval _eval
794+
alias __invoke _invoke
795+
private :__eval
796+
private :__invoke
797+
798+
attr_accessor :encoding
799+
800+
def _eval(cmd)
801+
if @encoding
802+
_fromUTF8(__eval(_toUTF8(cmd, @encoding)), @encoding)
803+
else
804+
__eval(cmd)
805+
end
806+
end
807+
808+
def _invoke(*cmds)
809+
if @encoding
810+
cmds = cmds.collect{|cmd| _toUTF8(cmd, @encoding)}
811+
_fromUTF8(__invoke(*cmds), @encoding)
812+
else
813+
__invoke(*cmds)
814+
end
815+
end
816+
end
817+
818+
module Tk
819+
def encoding=(name)
820+
INTERP.encoding = name
821+
end
822+
823+
def encoding
824+
INTERP.encoding
825+
end
826+
827+
def encoding_names
828+
tk_split_simplelist(tk_call('encoding', 'names'))
829+
end
830+
831+
def encoding_system
832+
tk_call('encoding', 'system')
833+
end
834+
835+
def encoding_system=(enc)
836+
tk_call('encoding', 'system', enc)
837+
end
838+
end
839+
840+
# estimate encoding
841+
case $KCODE
842+
when /^e/i # EUC
843+
Tk.encoding = 'euc-jp'
844+
when /^s/i # SJIS
845+
Tk.encoding = 'shiftjis'
846+
when /^u/i # UTF8
847+
Tk.encoding = 'utf-8'
848+
else # NONE
849+
begin
850+
Tk.encoding = Tk.encoding_system
851+
rescue StandardError, NameError
852+
Tk.encoding = 'utf-8'
853+
end
854+
end
855+
856+
else
857+
# dummy methods
858+
module Tk
859+
def encoding=(name)
860+
nil
861+
end
862+
def encoding
863+
nil
864+
end
865+
def encoding_names
866+
nil
867+
end
868+
def encoding_system
869+
nil
870+
end
871+
def encoding_system=(enc)
872+
nil
873+
end
874+
end
875+
end
876+
787877
module TkBindCore
788878
def bind(context, cmd=Proc.new, args=nil)
789879
Tk.bind(to_eval, context, cmd, args)

0 commit comments

Comments
 (0)