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)]];