diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index 73693d2b4..3b0ea5f37 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -275,11 +275,14 @@ weechat_perl_exec (struct t_plugin_script *script, if (script->interpreter) PERL_SET_CONTEXT (script->interpreter); #else - length = strlen (script->interpreter) + strlen (function) + 3; + length = strlen ((script->interpreter) ? script->interpreter : perl_main) + + strlen (function) + 3; func = (char *) malloc (length); if (!func) return NULL; - snprintf (func, length, "%s::%s", (char *) script->interpreter, function); + snprintf (func, length, "%s::%s", + (char *) ((script->interpreter) ? script->interpreter : perl_main), + function); #endif ENTER; |