From ef0e4684154e9370342759d08e7f517989a3a046 Mon Sep 17 00:00:00 2001 From: Emmanuel Bouthenot Date: Wed, 16 Nov 2005 21:13:56 +0000 Subject: [PATCH] fix a bug in plugin scripts : current_script was not set when exec a command --- src/plugins/scripts/perl/weechat-perl.c | 1 + src/plugins/scripts/python/weechat-python.c | 2 ++ weechat/src/plugins/scripts/perl/weechat-perl.c | 1 + weechat/src/plugins/scripts/python/weechat-python.c | 2 ++ 4 files changed, 6 insertions(+) diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index c7a5383e2..25cd2c633 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -122,6 +122,7 @@ weechat_perl_exec (t_weechat_plugin *plugin, func = function; PERL_SET_CONTEXT (script->interpreter); #endif + perl_current_script = script; dSP; ENTER; diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c index a28f85b9a..4fca21184 100644 --- a/src/plugins/scripts/python/weechat-python.c +++ b/src/plugins/scripts/python/weechat-python.c @@ -70,6 +70,8 @@ weechat_python_exec (t_weechat_plugin *plugin, } ret = -1; + + python_current_script = script; rc = PyObject_CallFunction(evFunc, "ss", server == NULL ? "" : server, arguments == NULL ? "" : arguments); diff --git a/weechat/src/plugins/scripts/perl/weechat-perl.c b/weechat/src/plugins/scripts/perl/weechat-perl.c index c7a5383e2..25cd2c633 100644 --- a/weechat/src/plugins/scripts/perl/weechat-perl.c +++ b/weechat/src/plugins/scripts/perl/weechat-perl.c @@ -122,6 +122,7 @@ weechat_perl_exec (t_weechat_plugin *plugin, func = function; PERL_SET_CONTEXT (script->interpreter); #endif + perl_current_script = script; dSP; ENTER; diff --git a/weechat/src/plugins/scripts/python/weechat-python.c b/weechat/src/plugins/scripts/python/weechat-python.c index a28f85b9a..4fca21184 100644 --- a/weechat/src/plugins/scripts/python/weechat-python.c +++ b/weechat/src/plugins/scripts/python/weechat-python.c @@ -70,6 +70,8 @@ weechat_python_exec (t_weechat_plugin *plugin, } ret = -1; + + python_current_script = script; rc = PyObject_CallFunction(evFunc, "ss", server == NULL ? "" : server, arguments == NULL ? "" : arguments);