From 2bee6f12ae028bba82e55cf5d38bd562d59726ef Mon Sep 17 00:00:00 2001 From: Jase Thew Date: Thu, 9 Dec 2010 09:51:58 +0000 Subject: [PATCH] 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 --- src/perl/perl-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/perl/perl-common.c b/src/perl/perl-common.c index 4018dcb1..daaa87f6 100644 --- a/src/perl/perl-common.c +++ b/src/perl/perl-common.c @@ -568,6 +568,7 @@ static void perl_register_protocol(CHAT_PROTOCOL_REC *rec) "Nick" }; static char *find_use_code = + "use lib qw(%s);\n" "my $pkg = Irssi::%s; $pkg =~ s/::/\\//;\n" "foreach my $i (@INC) {\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); } - 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); g_free(pcode);