]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Libravatar.pm
we need to unlink the temporary file name, not the temporary file handle
[debbugs.git] / Debbugs / Libravatar.pm
index ca9c035df350bd48c6e59b80d0c8316690c21143..8dcbad09033055b925a631b077005c4b89163014 100644 (file)
@@ -94,7 +94,7 @@ sub retrieve_libravatar{
         );
     my %param = @_;
     my $cache_location = $param{location};
-    $cache_location =~ s/\.[^\.]+$//;
+    $cache_location =~ s/\.[^\.\/]+$//;
     # take out a lock on the cache location so that if another request
     # is made while we are serving this one, we don't do double work
     my ($fh,$lockfile,$errors) =
@@ -159,7 +159,7 @@ sub retrieve_libravatar{
                    $temp_fn,
                    $cache_location.'.'.$dest_type) == 0 or
                        die "convert file failed";
-            unlink($temp_fh);
+            unlink($temp_fn);
         };
         if ($@) {
             unlink($cache_location.'.'.$dest_type) if -e $cache_location.'.'.$dest_type;