From 95dd5feb63743811ea3b040f5b58e409e7daf9f8 Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 29 Apr 2005 13:27:54 +0000 Subject: [PATCH] Fix bug where directories wrongly adopted resources as their children. --- src/helma/framework/repository/ZipRepository.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/helma/framework/repository/ZipRepository.java b/src/helma/framework/repository/ZipRepository.java index 5d568ce5..52204486 100644 --- a/src/helma/framework/repository/ZipRepository.java +++ b/src/helma/framework/repository/ZipRepository.java @@ -104,10 +104,14 @@ public final class ZipRepository extends AbstractRepository { String eName = entry.getName(); if (!eName.regionMatches(0, entryPath, 0, entryPath.length())) { - // not a child of ours + // names don't match - not a child of ours continue; } String[] entrypath = StringUtils.split(eName, "/"); + if (depth > 0 && !shortName.equals(entrypath[depth-1])) { + // catch case where our name is Foo and other's is FooBar + continue; + } // create new repositories and resources for all entries with a // path depth of this.depth + 1