[rt #93272] use absolute paths for plugins on android
authorBrian Fraser <fraserbn@gmail.com>
Mon, 31 Mar 2014 10:05:29 +0000 (21:05 +1100)
committerTony Cook <tony@develop-help.com>
Mon, 31 Mar 2014 10:06:29 +0000 (21:06 +1100)
Imager.pm

index 27220199e0907be2cd634a5f95fd650b304b3a51..1008f60e85f784be8e0057778ab465c03413d9b4 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -520,6 +520,12 @@ END {
 sub load_plugin {
   my ($filename)=@_;
   my $i;
+
+  if ($^O eq 'android') {
+    require File::Spec;
+    $filename = File::Spec->rel2abs($filename);
+  }
+
   my ($DSO_handle,$str)=DSO_open($filename);
   if (!defined($DSO_handle)) { $Imager::ERRSTR="Couldn't load plugin '$filename'\n"; return undef; }
   my %funcs=DSO_funclist($DSO_handle);
@@ -543,6 +549,11 @@ sub load_plugin {
 sub unload_plugin {
   my ($filename)=@_;
 
+  if ($^O eq 'android') {
+    require File::Spec;
+    $filename = File::Spec->rel2abs($filename);
+  }
+
   if (!$DSOs{$filename}) { $ERRSTR="plugin '$filename' not loaded."; return undef; }
   my ($DSO_handle,$funcref)=@{$DSOs{$filename}};
   for(keys %{$funcref}) {