summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c6
-rw-r--r--src/plugins/scripts/perl/weechat-perl.c6
-rw-r--r--src/plugins/scripts/python/weechat-python.c8
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby.c8
-rw-r--r--src/plugins/scripts/weechat-script.c16
-rw-r--r--weechat/ChangeLog3
-rw-r--r--weechat/src/plugins/scripts/lua/weechat-lua.c6
-rw-r--r--weechat/src/plugins/scripts/perl/weechat-perl.c6
-rw-r--r--weechat/src/plugins/scripts/python/weechat-python.c8
-rw-r--r--weechat/src/plugins/scripts/ruby/weechat-ruby.c8
-rw-r--r--weechat/src/plugins/scripts/weechat-script.c16
12 files changed, 38 insertions, 56 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f6c4f06f..ea72491ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2006-06-28
+ChangeLog - 2006-06-30
Version 0.2.0 (under dev!):
+ * fixed bug with spaces in script names (bug #16957)
* fixed random crash when "MODE #chan -l" is received
* fixed bug in IRC parser (random crash with malformed IRC messages)
* fixed refresh bug (too many refresh) when terminal is resized
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index 281350349..138258243 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -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;
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c
index 8d4928e3b..26a78fe1b 100644
--- a/src/plugins/scripts/perl/weechat-perl.c
+++ b/src/plugins/scripts/perl/weechat-perl.c
@@ -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);
diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c
index 99d6be83b..fd8651f2b 100644
--- a/src/plugins/scripts/python/weechat-python.c
+++ b/src/plugins/scripts/python/weechat-python.c
@@ -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 ();
diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c
index 4a07b5383..f786501f3 100644
--- a/src/plugins/scripts/ruby/weechat-ruby.c
+++ b/src/plugins/scripts/ruby/weechat-ruby.c
@@ -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;
}
diff --git a/src/plugins/scripts/weechat-script.c b/src/plugins/scripts/weechat-script.c
index 419b10adb..148f0f4c8 100644
--- a/src/plugins/scripts/weechat-script.c
+++ b/src/plugins/scripts/weechat-script.c
@@ -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;
}
diff --git a/weechat/ChangeLog b/weechat/ChangeLog
index 2f6c4f06f..ea72491ee 100644
--- a/weechat/ChangeLog
+++ b/weechat/ChangeLog
@@ -1,9 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2006-06-28
+ChangeLog - 2006-06-30
Version 0.2.0 (under dev!):
+ * fixed bug with spaces in script names (bug #16957)
* fixed random crash when "MODE #chan -l" is received
* fixed bug in IRC parser (random crash with malformed IRC messages)
* fixed refresh bug (too many refresh) when terminal is resized
diff --git a/weechat/src/plugins/scripts/lua/weechat-lua.c b/weechat/src/plugins/scripts/lua/weechat-lua.c
index 281350349..138258243 100644
--- a/weechat/src/plugins/scripts/lua/weechat-lua.c
+++ b/weechat/src/plugins/scripts/lua/weechat-lua.c
@@ -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;
diff --git a/weechat/src/plugins/scripts/perl/weechat-perl.c b/weechat/src/plugins/scripts/perl/weechat-perl.c
index 8d4928e3b..26a78fe1b 100644
--- a/weechat/src/plugins/scripts/perl/weechat-perl.c
+++ b/weechat/src/plugins/scripts/perl/weechat-perl.c
@@ -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);
diff --git a/weechat/src/plugins/scripts/python/weechat-python.c b/weechat/src/plugins/scripts/python/weechat-python.c
index 99d6be83b..fd8651f2b 100644
--- a/weechat/src/plugins/scripts/python/weechat-python.c
+++ b/weechat/src/plugins/scripts/python/weechat-python.c
@@ -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 ();
diff --git a/weechat/src/plugins/scripts/ruby/weechat-ruby.c b/weechat/src/plugins/scripts/ruby/weechat-ruby.c
index 4a07b5383..f786501f3 100644
--- a/weechat/src/plugins/scripts/ruby/weechat-ruby.c
+++ b/weechat/src/plugins/scripts/ruby/weechat-ruby.c
@@ -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;
}
diff --git a/weechat/src/plugins/scripts/weechat-script.c b/weechat/src/plugins/scripts/weechat-script.c
index 419b10adb..148f0f4c8 100644
--- a/weechat/src/plugins/scripts/weechat-script.c
+++ b/weechat/src/plugins/scripts/weechat-script.c
@@ -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;
}