mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 05:16:38 +02:00
Fixed bug with spaces in script names (bug #16957)
This commit is contained in:
@@ -203,10 +203,6 @@ weechat_lua_register (lua_State *L)
|
||||
}
|
||||
else
|
||||
{
|
||||
lua_plugin->print_server (lua_plugin,
|
||||
"Lua error: unable to load script "
|
||||
"\"%s\" (not enough memory)",
|
||||
name);
|
||||
lua_pushnumber (lua_current_interpreter, 0);
|
||||
return 1;
|
||||
}
|
||||
@@ -1728,7 +1724,7 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
|
||||
{
|
||||
plugin->print_server (plugin,
|
||||
"Lua error: function \"register\" not found "
|
||||
"in file \"%s\"",
|
||||
"(or failed) in file \"%s\"",
|
||||
filename);
|
||||
lua_close (lua_current_interpreter);
|
||||
return 0;
|
||||
|
||||
@@ -290,10 +290,6 @@ static XS (XS_weechat_register)
|
||||
}
|
||||
else
|
||||
{
|
||||
perl_plugin->print_server (perl_plugin,
|
||||
"Perl error: unable to load script "
|
||||
"\"%s\" (not enough memory)",
|
||||
name);
|
||||
XSRETURN_NO;
|
||||
}
|
||||
|
||||
@@ -1511,7 +1507,7 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
|
||||
{
|
||||
plugin->print_server (plugin,
|
||||
"Perl error: function \"register\" not found "
|
||||
"in file \"%s\"",
|
||||
"(or failed) in file \"%s\"",
|
||||
filename);
|
||||
#ifdef MULTIPLICITY
|
||||
perl_destruct (perl_current_interpreter);
|
||||
|
||||
@@ -223,13 +223,7 @@ weechat_python_register (PyObject *self, PyObject *args)
|
||||
name, version, description);
|
||||
}
|
||||
else
|
||||
{
|
||||
python_plugin->print_server (python_plugin,
|
||||
"Python error: unable to load script "
|
||||
"\"%s\" (not enough memory)",
|
||||
name);
|
||||
return Py_BuildValue ("i", 0);
|
||||
}
|
||||
|
||||
return Py_BuildValue ("i", 1);
|
||||
}
|
||||
@@ -1476,7 +1470,7 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
|
||||
{
|
||||
plugin->print_server (plugin,
|
||||
"Python error: function \"register\" not found "
|
||||
"in file \"%s\"",
|
||||
"(or failed) in file \"%s\"",
|
||||
filename);
|
||||
|
||||
if (PyErr_Occurred ()) PyErr_Print ();
|
||||
|
||||
@@ -271,13 +271,7 @@ weechat_ruby_register (VALUE class, VALUE name, VALUE version,
|
||||
c_name, c_version, c_description);
|
||||
}
|
||||
else
|
||||
{
|
||||
ruby_plugin->print_server (ruby_plugin,
|
||||
"Ruby error: unable to load script "
|
||||
"\"%s\" (not enough memory)",
|
||||
c_name);
|
||||
return INT2FIX (0);
|
||||
}
|
||||
|
||||
return INT2FIX (1);
|
||||
}
|
||||
@@ -1662,7 +1656,7 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
|
||||
if (ruby_current_script == NULL) {
|
||||
plugin->print_server (plugin,
|
||||
"Ruby error: function \"register\" not found "
|
||||
"in file \"%s\"",
|
||||
"(or failed) in file \"%s\"",
|
||||
filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -191,8 +191,14 @@ weechat_script_add (t_weechat_plugin *plugin,
|
||||
{
|
||||
t_plugin_script *new_script;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) plugin;
|
||||
if (strchr (name, ' '))
|
||||
{
|
||||
plugin->print_server (plugin,
|
||||
"Error: unable to load script "
|
||||
"\"%s\" (bad name, spaces are forbidden)",
|
||||
name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
new_script = (t_plugin_script *)malloc (sizeof (t_plugin_script));
|
||||
if (new_script)
|
||||
@@ -212,7 +218,11 @@ weechat_script_add (t_weechat_plugin *plugin,
|
||||
(*script_list) = new_script;
|
||||
return new_script;
|
||||
}
|
||||
|
||||
|
||||
plugin->print_server (plugin,
|
||||
"Error: unable to load script "
|
||||
"\"%s\" (not enough memory)",
|
||||
name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user