Fixed but when no parameter given for /perl and /python options

This commit is contained in:
Sebastien Helleu 2005-10-16 15:39:20 +00:00
parent 5a3976d6a5
commit 7bb815a540
4 changed files with 44 additions and 8 deletions

View File

@ -531,7 +531,13 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
(void) handler_args;
(void) handler_pointer;
argv = plugin->explode_string (plugin, arguments, " ", 0, &argc);
if (arguments)
argv = plugin->explode_string (plugin, arguments, " ", 0, &argc);
else
{
argv = NULL;
argc = 0;
}
switch (argc)
{
@ -639,7 +645,10 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
plugin->printf_server (plugin,
"Perl error: wrong argument count for \"perl\" command");
}
plugin->free_exploded_string (plugin, argv);
if (argv)
plugin->free_exploded_string (plugin, argv);
return 1;
}

View File

@ -670,7 +670,13 @@ weechat_python_cmd (t_weechat_plugin *plugin,
(void) handler_args;
(void) handler_pointer;
argv = plugin->explode_string (plugin, arguments, " ", 0, &argc);
if (arguments)
argv = plugin->explode_string (plugin, arguments, " ", 0, &argc);
else
{
argv = NULL;
argc = 0;
}
switch (argc)
{
@ -783,7 +789,10 @@ weechat_python_cmd (t_weechat_plugin *plugin,
plugin->printf_server (plugin,
"Python error: wrong argument count for \"python\" command");
}
plugin->free_exploded_string (plugin, argv);
if (argv)
plugin->free_exploded_string (plugin, argv);
return 1;
}

View File

@ -531,7 +531,13 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
(void) handler_args;
(void) handler_pointer;
argv = plugin->explode_string (plugin, arguments, " ", 0, &argc);
if (arguments)
argv = plugin->explode_string (plugin, arguments, " ", 0, &argc);
else
{
argv = NULL;
argc = 0;
}
switch (argc)
{
@ -639,7 +645,10 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
plugin->printf_server (plugin,
"Perl error: wrong argument count for \"perl\" command");
}
plugin->free_exploded_string (plugin, argv);
if (argv)
plugin->free_exploded_string (plugin, argv);
return 1;
}

View File

@ -670,7 +670,13 @@ weechat_python_cmd (t_weechat_plugin *plugin,
(void) handler_args;
(void) handler_pointer;
argv = plugin->explode_string (plugin, arguments, " ", 0, &argc);
if (arguments)
argv = plugin->explode_string (plugin, arguments, " ", 0, &argc);
else
{
argv = NULL;
argc = 0;
}
switch (argc)
{
@ -783,7 +789,10 @@ weechat_python_cmd (t_weechat_plugin *plugin,
plugin->printf_server (plugin,
"Python error: wrong argument count for \"python\" command");
}
plugin->free_exploded_string (plugin, argv);
if (argv)
plugin->free_exploded_string (plugin, argv);
return 1;
}