sort_elements: fix dropping parents
authorIan Beckwith <ianb@erislabs.net>
Sun, 10 Oct 2010 23:11:07 +0000 (00:11 +0100)
committerIan Beckwith <ianb@erislabs.net>
Sun, 10 Oct 2010 23:11:07 +0000 (00:11 +0100)
lib/ID3FS/Path.pm

index 9078720..0559463 100644 (file)
@@ -361,7 +361,7 @@ sub sort_elements
        if(ref($thing) eq "ID3FS::PathElement::Tag")
        {
            # Handle tag values by dropping parent
-           if(@input && ref($input[$#input]) eq "ID3FS::PathElement::Tag")
+           if(@input && ref($input[0]) eq "ID3FS::PathElement::Tag")
            {
                $thing=shift @input;
            }
@@ -382,7 +382,7 @@ sub sort_elements
     {
        push(@output, pop(@opstack));
     }
-#   print "STACK: ", join(', ', map { $_->{name}; } @output), "\n";
+#    print "STACK: ", join(', ', map { $_->{name}; } @output), "\n";
     return @output;
 }