Skip to content

Commit 44a4158

Browse files
committed
Fix #9642: use platform-independent path separator
1 parent 5934602 commit 44a4158

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/classpath/ClassPath.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ trait SourceFileEntry extends ClassRepresentation {
2424

2525
case class PackageName(dottedString: String) {
2626
def isRoot: Boolean = dottedString.isEmpty
27-
val dirPathTrailingSlash: String = FileUtils.dirPath(dottedString) + "/"
27+
val dirPathTrailingSlash: String = FileUtils.dirPath(dottedString) + java.io.File.separator
2828

2929
def entryName(entry: String): String = {
3030
if (isRoot) entry else {

compiler/src/dotty/tools/io/ZipArchive.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ final class FileZipArchive(jpath: JPath) extends ZipArchive(jpath) {
199199
final class ManifestResources(val url: URL) extends ZipArchive(null) {
200200
def iterator(): Iterator[AbstractFile] = {
201201
val root = new DirEntry("/", null)
202-
val dirs = new mutable.HashMap[String, DirEntry]; dirs.put("/", root)
202+
val dirs = mutable.HashMap[String, DirEntry]("/" -> root)
203203
val manifest = new Manifest(input)
204204
val iter = manifest.getEntries().keySet().iterator().asScala.filter(_.endsWith(".class")).map(new ZipEntry(_))
205205

0 commit comments

Comments
 (0)