diff options
| author | Jeroen Frijters <jeroen@sumatra.nl> | 2004-12-12 19:10:28 +0000 |
|---|---|---|
| committer | Jeroen Frijters <jeroen@sumatra.nl> | 2004-12-12 19:10:28 +0000 |
| commit | 7249c2d45dd247abbf671d7628a2bf61e350b55e (patch) | |
| tree | dda5314fdd22bbb7bc2ac19ba467cfc31693a93c /java/util/zip/ZipFile.java | |
| parent | a8ef6b178572ca5ae04b4ab3b2190970f470f759 (diff) | |
| download | classpath-7249c2d45dd247abbf671d7628a2bf61e350b55e.tar.gz | |
2004-12-12 Jeroen Frijters <jeroen@frijters.net>
* java/util/zip/ZipFile.java
(getEntry): Fix to find dir entries without slash.
* java/util/zip/ZipEntry.java
(ZipEntry(ZipEntry,String)): New constructor to copy and change name.
(ZipEntry(ZipEntry)): Delegate to new constructor.
Diffstat (limited to 'java/util/zip/ZipFile.java')
| -rw-r--r-- | java/util/zip/ZipFile.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/java/util/zip/ZipFile.java b/java/util/zip/ZipFile.java index 38ec9e6b5..b8773d578 100644 --- a/java/util/zip/ZipFile.java +++ b/java/util/zip/ZipFile.java @@ -358,7 +358,10 @@ public class ZipFile implements ZipConstants { HashMap entries = getEntries(); ZipEntry entry = (ZipEntry) entries.get(name); - return entry != null ? (ZipEntry) entry.clone() : null; + // If we didn't find it, maybe it's a directory. + if (entry == null && !name.endsWith("/")) + entry = (ZipEntry) entries.get(name + '/'); + return entry != null ? new ZipEntry(entry, name) : null; } catch (IOException ioe) { |
