fix pruning tags + only prune files/dirs under @ARGV
[id3fs.git] / bin / id3fs-index
index f27c7f6..4ee56e5 100755 (executable)
@@ -75,7 +75,7 @@ else
     $db->last_update(time());
     my $base=$db->base_dir();
     my $abs_base=Cwd::abs_path($base);
-    while(my $path=shift)
+    for my $path (@ARGV)
     {
        if(Cwd::abs_path($path) !~ /^$abs_base/)
        {
@@ -83,7 +83,7 @@ else
        }
        File::Find::find( {wanted => \&wanted, follow => 1, no_chdir => 1}, $path);
     }
-    my $directories_pruned=$db->prune_directories();
+    my $directories_pruned=$db->prune_directories(@ARGV);
     if($files_pruned || $directories_pruned)
     {
        print "$me: pruning removed files from db\n" if $verbose;