From 3b9392a0b36207bd7bf3056374bd9c36b9be7b31 Mon Sep 17 00:00:00 2001 From: silverleo Date: Sun, 9 May 2010 17:24:02 +0000 Subject: [PATCH] Fixed modtcl result fetching from the interpreter. Tcl 8.6 no longer supports accessing the result field directly, so we now use the public getter. Thanks to flakes for finding this. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1970 726aef4b-f618-498e-8847-2d620e286838 --- modules/extra/modtcl.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/extra/modtcl.cpp b/modules/extra/modtcl.cpp index 12afc4b6..3a10e9de 100644 --- a/modules/extra/modtcl.cpp +++ b/modules/extra/modtcl.cpp @@ -106,8 +106,7 @@ public: if (!sMyArgs.empty()) { i = Tcl_EvalFile(interp, sMyArgs.c_str()); if (i != TCL_OK) { - result = interp->result; - PutModule(CString(result)); + PutModule(Tcl_GetStringResult(interp)); } } @@ -140,8 +139,7 @@ public: while (Tcl_DoOneEvent(TCL_DONT_WAIT)) {} i = Tcl_Eval(interp,"Binds::ProcessTime"); if (i != TCL_OK) { - result = interp->result; - PutModule(CString(result)); + PutModule(Tcl_GetStringResult(interp)); } } @@ -183,8 +181,7 @@ public: CString sCommand = "Binds::ProcessPubm {" + sNick + "} {" + sHost + "} - {" + sChannel + "} {" + sMes + "}"; i = Tcl_Eval(interp, sCommand.c_str()); if (i != TCL_OK) { - result = interp->result; - PutModule(CString(result)); + PutModule(Tcl_GetStringResult(interp)); } return CONTINUE; } @@ -201,8 +198,7 @@ public: sCommand = "Binds::ProcessNick {" + sOldNick + "} {" + sHost + "} - {" + vChans[n]->GetName() + "} {" + sNewNickTmp + "}"; i = Tcl_Eval(interp, sCommand.c_str()); if (i != TCL_OK) { - result = interp->result; - PutModule(CString(result)); + PutModule(Tcl_GetStringResult(interp)); } } } @@ -215,8 +211,7 @@ public: CString sCommand = "Binds::ProcessKick {" + sOpNick + "} {" + sOpHost + "} - {" + Channel.GetName() + "} {" + sNick + "} {" + sMessage + "}"; i = Tcl_Eval(interp, sCommand.c_str()); if (i != TCL_OK) { - result = interp->result; - PutModule(CString(result)); + PutModule(Tcl_GetStringResult(interp)); } } @@ -224,7 +219,6 @@ public: private: Tcl_Interp *interp; int i; - char *result; static CString argvit(const char *argv[], unsigned int end, unsigned int begin, CString delim) { CString sRet;