Bug fixes.
[pithos-macos] / pithos-macos / PithosContainerNode.m
index 5631490..cccdd13 100644 (file)
@@ -247,7 +247,8 @@ static NSImage *sharedIcon = nil;
                 BOOL isSubdirNode = ([self class] == [PithosSubdirNode class]);
                 for (ASIPithosObject *object in objects) {
                     if (!isSubdirNode || 
-                        [object.name hasPrefix:[((PithosSubdirNode *)self).prefix stringByAppendingString:@"/"]]) {
+                        ([object.name hasPrefix:[((PithosSubdirNode *)self).prefix stringByAppendingString:@"/"]] &&
+                         ([object.name length] > [((PithosSubdirNode *)self).prefix length] + 1))) {
                         // The check above removes false objects due to trailing slash or same prefix
                         if (object.subdir) {
                             NSUInteger sameNameObjectIndex = [objectNames indexOfObject:[object.name substringToIndex:([object.name length] - 1)]];