src/jdk.jartool/share/classes/sun/tools/jar/Main.java
changeset 51188 630b5e06a947
parent 50603 95c0644a1c47
child 52723 f24ae8376e71
--- a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java	Mon Jul 23 22:07:55 2018 -0700
+++ b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java	Thu Jul 19 11:04:46 2018 +0200
@@ -633,10 +633,15 @@
                         dir = (dir.endsWith(File.separator) ?
                                dir : (dir + File.separator));
                         dir = dir.replace(File.separatorChar, '/');
+
+                        boolean hasUNC = (File.separatorChar == '\\'&&  dir.startsWith("//"));
                         while (dir.indexOf("//") > -1) {
                             dir = dir.replace("//", "/");
                         }
-                        pathsMap.get(version).add(dir.replace(File.separatorChar, '/'));
+                        if (hasUNC) { // Restore Windows UNC path.
+                            dir = "/" + dir;
+                        }
+                        pathsMap.get(version).add(dir);
                         nameBuf[k++] = dir + args[++i];
                     } else if (args[i].startsWith("--release")) {
                         int v = BASE_VERSION;