Index: trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 6150)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 6151)
@@ -159,10 +159,13 @@
     /**
      * Returns the parent directory of the resource inside the zip file.
-     * @return null, if zipEntryPath is null, otherwise the parent directory of
-     * the resource inside the zip file
+     * @return the parent directory of the resource inside the zip file,
+     * "." if zipEntryPath is a top level file; null, if zipEntryPath is null
      */
     public String getZipEntryDirName() {
         if (zipEntryPath == null) return null;
-        return new File(zipEntryPath).getParent().toString();
+        File file = new File(zipEntryPath);
+        File dir = file.getParentFile();
+        if (dir == null) return ".";
+        return dir.getPath();
     }
 }
Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 6150)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 6151)
@@ -539,11 +539,10 @@
         {
             zipFile = new ZipFile(archive);
-            String entry_name;
-            if (inArchiveDir != null) {
-                File dir = new File(inArchiveDir);
-                entry_name = new File(dir, full_name).getPath();
-            } else {
-                entry_name = full_name;
-            }
+            if (inArchiveDir == null || inArchiveDir.equals(".")) {
+                inArchiveDir = "";
+            } else if (!inArchiveDir.isEmpty()) {
+                inArchiveDir += "/";
+            }
+            String entry_name = inArchiveDir + full_name;
             ZipEntry entry = zipFile.getEntry(entry_name);
             if(entry != null)
