more robust;
authorwenzelm
Thu, 08 Jul 2021 22:21:31 +0200
changeset 74212 cc49da3003aa
parent 74211 714c267bb6fa
child 74213 f209845d3a5d
more robust;
src/Tools/Setup/isabelle/setup/Build.java
--- a/src/Tools/Setup/isabelle/setup/Build.java	Thu Jul 08 22:17:20 2021 +0200
+++ b/src/Tools/Setup/isabelle/setup/Build.java	Thu Jul 08 22:21:31 2021 +0200
@@ -193,11 +193,13 @@
                 boolean is_file = Files.isRegularFile(path);
                 if (is_dir || is_file) {
                     String name = Environment.slashes(dir.relativize(path).toString());
-                    JarEntry entry = new JarEntry(is_dir ? name + "/" : name);
-                    entry.setTime(path.toFile().lastModified());
-                    out.putNextEntry(entry);
-                    if (is_file) { out.write(Files.readAllBytes(path)); }
-                    out.closeEntry();
+                    if (!name.isEmpty()) {
+                        JarEntry entry = new JarEntry(is_dir ? name + "/" : name);
+                        entry.setTime(path.toFile().lastModified());
+                        out.putNextEntry(entry);
+                        if (is_file) { out.write(Files.readAllBytes(path)); }
+                        out.closeEntry();
+                    }
                 }
             }
         }