1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Add the path contained in the perl_use_lib setting to the search list

when attempting to automatically use chat_protocol perl modules. This
fixes the automatic calling of "use Irssi::Irc" when the Irssi perl modules
have been installed in a location outside of perl's site/vendor hierarchy.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5197 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Jase Thew 2010-12-09 09:51:58 +00:00 committed by bazerka
parent 81b8dcdeb2
commit 2bee6f12ae

View File

@ -568,6 +568,7 @@ static void perl_register_protocol(CHAT_PROTOCOL_REC *rec)
"Nick" "Nick"
}; };
static char *find_use_code = static char *find_use_code =
"use lib qw(%s);\n"
"my $pkg = Irssi::%s; $pkg =~ s/::/\\//;\n" "my $pkg = Irssi::%s; $pkg =~ s/::/\\//;\n"
"foreach my $i (@INC) {\n" "foreach my $i (@INC) {\n"
" return 1 if (-f \"$i/$pkg.pm\");\n" " return 1 if (-f \"$i/$pkg.pm\");\n"
@ -626,7 +627,8 @@ static void perl_register_protocol(CHAT_PROTOCOL_REC *rec)
perl_eval_pv(code, TRUE); perl_eval_pv(code, TRUE);
} }
pcode = g_strdup_printf(find_use_code, name); pcode = g_strdup_printf(find_use_code,
settings_get_str("perl_use_lib"), name);
sv = perl_eval_pv(pcode, TRUE); sv = perl_eval_pv(pcode, TRUE);
g_free(pcode); g_free(pcode);