aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-29 05:07:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-29 05:07:26 +0000
commit88abd791f522c7097141753c3480a456340215f8 (patch)
treeac7f94b43697aed5cb9306aa19a904f08ab8a2d7 /ext
parent429f7ed113dc862b121ab63c73170e4169853581 (diff)
downloadruby-88abd791f522c7097141753c3480a456340215f8.tar.gz
* parse.y (str_extend): shuould allow interpolation of $-x.
* variable.c (rb_cvar_set): empty iv_tbl may cause infinite loop. * variable.c (rb_cvar_get): ditto. * variable.c (cvar_override_check): ditto. * bignum.c (rb_big_eq): convert Bignum to Float, instead of reverse. * time.c (time_localtime): getting tm should not be prohibited for frozen time objects. * time.c (time_gmtime): ditto. * version.c (Init_version): freeze RUBY_VERSION, RUBY_RELEASE_DATE, and RUBY_PLATFORM. * file.c (Init_File): freeze File::SEPARATOR, ALT_SEPARATOR and PATH_SEPARATOR. * file.c (rb_stat_cmp): should check operand type before calling get_stat(). * eval.c (rb_eval_cmd): should not invoke "call" with a block on any occasion. * numeric.c (fix_aref): idx may be a Bignum. * numeric.c (num_remainder): a bug in Numeric#remainder. * eval.c (rb_exec_end_proc): END might be called within END block. * class.c (rb_mod_clone): should not copy class name, since clone should remain anonymous. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/socket.c2
-rw-r--r--ext/tcltklib/tcltklib.c4
-rw-r--r--ext/tk/lib/tk.rb17
3 files changed, 21 insertions, 2 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 8974096bbc..e1f84376aa 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -849,9 +849,11 @@ open_inet(class, remote_host, remote_serv, local_host, local_serv, type)
continue;
}
if (type == INET_SERVER) {
+#ifndef NT
status = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
(char*)&status, sizeof(status));
+#endif
status = bind(fd, res->ai_addr, res->ai_addrlen);
syscall = "bind(2)";
}
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 6c95b42b37..e9c2b56fc1 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -157,7 +157,9 @@ ip_ruby(clientData, interp, argc, argv)
DUMP2("rb_eval_string(%s)", arg);
old_trapflg = rb_trap_immediate;
rb_trap_immediate = 0;
- res = rb_rescue(rb_eval_string, (VALUE)arg, ip_eval_rescue, (VALUE)&failed);
+ res = rb_rescue2(rb_eval_string, (VALUE)arg,
+ ip_eval_rescue, (VALUE)&failed,
+ rb_eStandardError, rb_eScriptError, 0);
rb_trap_immediate = old_trapflg;
Tcl_ResetResult(interp);
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index e64a6b3af7..967d185053 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -77,6 +77,9 @@ module TkComm
def tk_split_list(str)
return [] if str == ""
idx = str.index('{')
+ while idx and idx > 0 and str[idx-1] == ?\\
+ idx = str.index('{', idx+1)
+ end
return tk_tcl2ruby(str) unless idx
list = tk_tcl2ruby(str[0,idx])
@@ -90,6 +93,7 @@ module TkComm
brace -= 1 if c == ?}
break if brace == 0
}
+ p str[0,i]
if str[0, i] == ' '
list.push ' '
else
@@ -102,6 +106,9 @@ module TkComm
def tk_split_simplelist(str)
return [] if str == ""
idx = str.index('{')
+ while idx and idx > 0 and str[idx-1] == ?\\
+ idx = str.index('{', idx+1)
+ end
return str.split unless idx
list = str[0,idx].split
@@ -467,7 +474,15 @@ module TkCore
INTERP = TclTkIp.new
- INTERP._invoke("proc", "rb_out", "args", "if {[set st [catch {ruby [format \"TkCore.callback %%Q!%s!\" $args]} ret]] != 0} {if {[regsub -all {!} $args {\\!} newargs] == 0} {return -code $st $ret} {if {[set st [catch {ruby [format \"TkCore.callback %%Q!%s!\" $newargs]} ret]] != 0} {return -code $st $ret} {return $ret}}} {return $ret}")
+ INTERP._invoke("proc", "rb_out", "args", <<-'EOL')
+ regsub -all {!} $args {\\!} args
+ regsub -all "{" $args "\\{" args
+ if {[set st [catch {ruby [format "TkCore.callback %%Q!%s!" $args]} ret]] != 0} {
+ return -code $st $ret
+ } {
+ return $ret
+ }
+ EOL
def callback_break
fail TkCallbackBreak, "Tk callback returns 'break' status"