tcktklib.c patch

From: "Kent S." <ksibilev@...>
Date: 2004-04-29 22:21:22 UTC
List: ruby-core #2833
Since Exception#to_str method has been removed in favor of #message 
method,
tcltklib extension should be updated accordingly.

Index: tcltklib.c
===================================================================
RCS file: /src/ruby/ext/tcltklib/tcltklib.c,v
retrieving revision 1.52
diff -u -r1.52 tcltklib.c
--- tcltklib.c  29 Mar 2004 07:54:26 -0000      1.52
+++ tcltklib.c  29 Apr 2004 22:13:02 -0000
@@ -833,14 +833,15 @@
          VALUE eclass = rb_obj_class(arg.failed);
         DUMP1("(rb_eval_string result) failed");
         Tcl_ResetResult(interp);
-       Tcl_AppendResult(interp, StringValuePtr(arg.failed), 
(char*)NULL);
          if (eclass == eTkCallbackBreak) {
             return TCL_BREAK;
         } else if (eclass == eTkCallbackContinue) {
             return TCL_CONTINUE;
         } else if (eclass == rb_eSystemExit) {
+           VALUE msg = rb_funcall(arg.failed, rb_intern("message"), 0);
+            Tcl_AppendResult(interp, StringValuePtr(msg), (char*)NULL);
             Tcl_Eval(interp, "destroy .");
-           rb_raise(rb_eSystemExit, StringValuePtr(arg.failed));
+           rb_raise(rb_eSystemExit, StringValuePtr(msg));
         } else {
             return TCL_ERROR;
         }


Cheers,
Kent.


In This Thread

Prev Next