summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/perl
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-10-16 15:39:20 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-10-16 15:39:20 +0000
commit7bb815a540e6c9a2e8c7be788d853771d7c7af45 (patch)
tree07006352ae5a62aa039d213a9d8963da68481497 /src/plugins/scripts/perl
parent5a3976d6a5582c81c7adcc0cbf9821ded181c6cb (diff)
downloadweechat-7bb815a540e6c9a2e8c7be788d853771d7c7af45.zip
Fixed but when no parameter given for /perl and /python options
Diffstat (limited to 'src/plugins/scripts/perl')
-rw-r--r--src/plugins/scripts/perl/weechat-perl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c
index 504a0a596..543c39ba5 100644
--- a/src/plugins/scripts/perl/weechat-perl.c
+++ b/src/plugins/scripts/perl/weechat-perl.c
@@ -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;
}