summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/scripts/guile/weechat-guile-api.c12
-rw-r--r--src/plugins/scripts/lua/weechat-lua-api.c11
-rw-r--r--src/plugins/scripts/perl/weechat-perl-api.c12
-rw-r--r--src/plugins/scripts/python/weechat-python-api.c12
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby-api.c12
-rw-r--r--src/plugins/scripts/tcl/weechat-tcl-api.c12
6 files changed, 66 insertions, 5 deletions
diff --git a/src/plugins/scripts/guile/weechat-guile-api.c b/src/plugins/scripts/guile/weechat-guile-api.c
index 95b309b08..fe5e3c49e 100644
--- a/src/plugins/scripts/guile/weechat-guile-api.c
+++ b/src/plugins/scripts/guile/weechat-guile-api.c
@@ -87,6 +87,16 @@ weechat_guile_api_register (SCM name, SCM author, SCM version, SCM license,
SCM description, SCM shutdown_func, SCM charset)
{
API_FUNC(0, "register", API_RETURN_ERROR);
+ if (guile_registered_script)
+ {
+ /* script already registered */
+ weechat_printf (NULL,
+ weechat_gettext ("%s%s: script \"%s\" already "
+ "registered (register ignored)"),
+ weechat_prefix ("error"), GUILE_PLUGIN_NAME,
+ guile_registered_script->name);
+ API_RETURN_ERROR;
+ }
guile_current_script = NULL;
guile_registered_script = NULL;
if (!scm_is_string (name) || !scm_is_string (author)
@@ -98,7 +108,7 @@ weechat_guile_api_register (SCM name, SCM author, SCM version, SCM license,
if (script_search (weechat_guile_plugin, guile_scripts,
scm_i_string_chars (name)))
{
- /* error: another scripts already exists with this name! */
+ /* another script already exists with same name */
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to register script "
"\"%s\" (another script already "
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c
index 29668aa11..85a91076b 100644
--- a/src/plugins/scripts/lua/weechat-lua-api.c
+++ b/src/plugins/scripts/lua/weechat-lua-api.c
@@ -94,6 +94,16 @@ weechat_lua_api_register (lua_State *L)
const char *shutdown_func, *charset;
API_FUNC(0, "register", API_RETURN_ERROR);
+ if (lua_registered_script)
+ {
+ /* script already registered */
+ weechat_printf (NULL,
+ weechat_gettext ("%s%s: script \"%s\" already "
+ "registered (register ignored)"),
+ weechat_prefix ("error"), LUA_PLUGIN_NAME,
+ lua_registered_script->name);
+ API_RETURN_ERROR;
+ }
lua_current_script = NULL;
lua_registered_script = NULL;
if (lua_gettop (lua_current_interpreter) < 7)
@@ -109,6 +119,7 @@ weechat_lua_api_register (lua_State *L)
if (script_search (weechat_lua_plugin, lua_scripts, name))
{
+ /* another script already exists with same name */
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to register script "
"\"%s\" (another script already "
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c
index c2f7a8162..ccd1a6a2d 100644
--- a/src/plugins/scripts/perl/weechat-perl-api.c
+++ b/src/plugins/scripts/perl/weechat-perl-api.c
@@ -107,6 +107,16 @@ XS (XS_weechat_api_register)
(void) items;
API_FUNC(0, "register", API_RETURN_ERROR);
+ if (perl_registered_script)
+ {
+ /* script already registered */
+ weechat_printf (NULL,
+ weechat_gettext ("%s%s: script \"%s\" already "
+ "registered (register ignored)"),
+ weechat_prefix ("error"), PERL_PLUGIN_NAME,
+ perl_registered_script->name);
+ API_RETURN_ERROR;
+ }
perl_current_script = NULL;
perl_registered_script = NULL;
@@ -123,7 +133,7 @@ XS (XS_weechat_api_register)
if (script_search (weechat_perl_plugin, perl_scripts, name))
{
- /* error: another script already exists with this name! */
+ /* another script already exists with same name */
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to register script "
"\"%s\" (another script already "
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c
index bc1076fb0..a382ef062 100644
--- a/src/plugins/scripts/python/weechat-python-api.c
+++ b/src/plugins/scripts/python/weechat-python-api.c
@@ -90,6 +90,16 @@ weechat_python_api_register (PyObject *self, PyObject *args)
char *charset;
API_FUNC(0, "register", API_RETURN_ERROR);
+ if (python_registered_script)
+ {
+ /* script already registered */
+ weechat_printf (NULL,
+ weechat_gettext ("%s%s: script \"%s\" already "
+ "registered (register ignored)"),
+ weechat_prefix ("error"), PYTHON_PLUGIN_NAME,
+ python_registered_script->name);
+ API_RETURN_ERROR;
+ }
python_current_script = NULL;
python_registered_script = NULL;
name = NULL;
@@ -105,7 +115,7 @@ weechat_python_api_register (PyObject *self, PyObject *args)
if (script_search (weechat_python_plugin, python_scripts, name))
{
- /* error: another scripts already exists with this name! */
+ /* another script already exists with same name */
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to register script "
"\"%s\" (another script already "
diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c
index 1bc01b1fd..3cef992ae 100644
--- a/src/plugins/scripts/ruby/weechat-ruby-api.c
+++ b/src/plugins/scripts/ruby/weechat-ruby-api.c
@@ -91,6 +91,16 @@ weechat_ruby_api_register (VALUE class, VALUE name, VALUE author,
char *c_shutdown_func, *c_charset;
API_FUNC(0, "register", API_RETURN_ERROR);
+ if (ruby_registered_script)
+ {
+ /* script already registered */
+ weechat_printf (NULL,
+ weechat_gettext ("%s%s: script \"%s\" already "
+ "registered (register ignored)"),
+ weechat_prefix ("error"), RUBY_PLUGIN_NAME,
+ ruby_registered_script->name);
+ API_RETURN_ERROR;
+ }
ruby_current_script = NULL;
ruby_registered_script = NULL;
if (NIL_P (name) || NIL_P (author) || NIL_P (version)
@@ -116,7 +126,7 @@ weechat_ruby_api_register (VALUE class, VALUE name, VALUE author,
if (script_search (weechat_ruby_plugin, ruby_scripts, c_name))
{
- /* error: another scripts already exists with this name! */
+ /* another script already exists with same name */
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to register script "
"\"%s\" (another script already "
diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c
index c282242e4..6762516b5 100644
--- a/src/plugins/scripts/tcl/weechat-tcl-api.c
+++ b/src/plugins/scripts/tcl/weechat-tcl-api.c
@@ -218,6 +218,16 @@ weechat_tcl_api_register (ClientData clientData, Tcl_Interp *interp, int objc,
int i;
API_FUNC(0, "register", API_RETURN_ERROR);
+ if (tcl_registered_script)
+ {
+ /* script already registered */
+ weechat_printf (NULL,
+ weechat_gettext ("%s%s: script \"%s\" already "
+ "registered (register ignored)"),
+ weechat_prefix ("error"), TCL_PLUGIN_NAME,
+ tcl_registered_script->name);
+ API_RETURN_ERROR;
+ }
tcl_current_script = NULL;
tcl_registered_script = NULL;
@@ -234,7 +244,7 @@ weechat_tcl_api_register (ClientData clientData, Tcl_Interp *interp, int objc,
if (script_search (weechat_tcl_plugin, tcl_scripts, name))
{
- /* error: another script already exists with this name! */
+ /* another script already exists with same name */
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to register script "
"\"%s\" (another script already "