diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-02-28 21:11:34 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-02-28 21:11:34 +0000 |
commit | e4cc18210575125c7aea1ce62496772f73768158 (patch) | |
tree | e9f1d1bbdd1b94a020151d8aa8f8b3a84e8e32e0 /src/plugins/scripts/perl/weechat-perl.c | |
parent | 8c662f69f97d1adfd83c8fd7b6427bdfa386ca98 (diff) | |
download | weechat-e4cc18210575125c7aea1ce62496772f73768158.zip |
Script plugins now load scripts in WeeChat system share directory
Diffstat (limited to 'src/plugins/scripts/perl/weechat-perl.c')
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index f8c581480..c1605e22a 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -1401,8 +1401,8 @@ weechat_perl_cmd (t_weechat_plugin *plugin, char *server, char *command, char *arguments, char *handler_args, void *handler_pointer) { - int argc, path_length, handler_found; - char **argv, *path_script, *dir_home; + int argc, handler_found; + char **argv, *path_script; t_plugin_script *ptr_script; t_plugin_handler *ptr_handler; @@ -1513,25 +1513,7 @@ weechat_perl_cmd (t_weechat_plugin *plugin, if (plugin->ascii_strcasecmp (plugin, argv[0], "load") == 0) { /* load Perl script */ - if ((strstr (argv[1], "/")) || (strstr (argv[1], "\\"))) - path_script = NULL; - else - { - dir_home = plugin->get_info (plugin, "weechat_dir", NULL); - if (dir_home) - { - path_length = strlen (dir_home) + strlen (argv[1]) + 16; - path_script = (char *) malloc (path_length * sizeof (char)); - if (path_script) - snprintf (path_script, path_length, "%s/perl/%s", - dir_home, argv[1]); - else - path_script = NULL; - free (dir_home); - } - else - path_script = NULL; - } + path_script = weechat_script_search_full_name (plugin, "perl", argv[1]); weechat_perl_load (plugin, (path_script) ? path_script : argv[1]); if (path_script) free (path_script); |