From 780a7478ee02952c23ff7b71d1ec7bc02fdad5ce Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 6 Mar 2009 23:46:51 +0100 Subject: [PATCH] Fix bug with namespace in tcl plugin (bug #25754) --- src/plugins/scripts/tcl/weechat-tcl-api.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index 59927ec36..94e32e718 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -130,7 +130,7 @@ if (__string) \ { \ Tcl_SetStringObj (objp, __string, -1); \ - free(__string); \ + free (__string); \ return TCL_OK; \ } \ Tcl_SetStringObj (objp, "", -1); \ @@ -6056,18 +6056,16 @@ weechat_tcl_api_upgrade_close (ClientData clientData, Tcl_Interp *interp, * weechat_tcl_api_init: initialize subroutines */ -void weechat_tcl_api_init (Tcl_Interp *interp) { +void weechat_tcl_api_init (Tcl_Interp *interp) +{ int i; Tcl_Obj *objp; /* standard initializer */ Tcl_Init (interp); -#ifdef HAVE_TCL_CREATE_NS - /* create weechat namespace */ - Tcl_CreateNamespace (interp, "weechat", (ClientData)0, NULL); -#endif - + Tcl_Eval (interp,"namespace eval weechat {}"); + /* interface constants */ /* set variables, TODO: make them unmodifiable (thru Tcl_TraceVar) ? */ /* NOTE: it is not good for performance to convert "defines" to Tcl_Obj */