From 095d32556c518e4179128df9752034c1b4aba95d Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 14 Jul 2012 20:52:41 +0200 Subject: Update XChat to r1519 --- plugins/perl/lib/Xchat/Embed.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'plugins/perl/lib/Xchat') diff --git a/plugins/perl/lib/Xchat/Embed.pm b/plugins/perl/lib/Xchat/Embed.pm index 1b779f80..c5857eb0 100644 --- a/plugins/perl/lib/Xchat/Embed.pm +++ b/plugins/perl/lib/Xchat/Embed.pm @@ -259,7 +259,7 @@ sub find_external_pkg { return @frame if $frame[0] !~ /(?:^IRC$|^Xchat)/; $level++; } - + return; } sub find_pkg { @@ -281,7 +281,7 @@ sub find_pkg { if( $frame[0] or $frame[1] ) { my $calling_package = $frame[0]; if( defined( my $owner = $owner_package{ $calling_package } ) ) { - return $owner; + return ($owner, $calling_package); } $location = $frame[1] ? $frame[1] : "package $frame[0]"; @@ -294,10 +294,16 @@ sub find_pkg { } +# convert function names into code references sub fix_callback { - my ($package, $callback) = @_; + my ($package, $calling_package, $callback) = @_; unless( ref $callback ) { + unless( $callback =~ /::/ ) { + my $prefix = defined $calling_package ? $calling_package : $package; + $callback =~ s/^/${prefix}::/; + } + no strict 'subs'; $callback = \&{$callback}; } -- cgit 1.4.1