fix DXUtil::localdata ?perl bug?
[spider.git] / perl / DXUtil.pm
index 28e7396dcebd3143d25d29b49c989e98c4c7592d..8bb9b956c59d306b8aab36b6cab0807bca10c5bd 100644 (file)
@@ -472,15 +472,15 @@ sub deleteitem
 sub localdata
 {
        my $ifn = shift;
-       my $ofn = "$main::data/$ifn";
+       my $ofn = "$main::local_data/$ifn";
        my $tfn;
        
        if (-e "$main::local_data") {
-               $tfn = "$main::local_data/$ifn";
-               if (-e $tfn && -e $ofn) {
-                       $ofn = $tfn if -M $tfn < -M $ofn;
-               } elsif (-e $tfn) {
-                       $ofn = $tfn;
+               $tfn = "$main::data/$ifn";
+               if ((-e $tfn) && (-e $ofn)) {
+                       $ofn = $tfn if -M $ofn < -M $tfn;
+               } else {
+                       $ofn = $tfn if -e $tfn;
                }
        }