Skip to content

Commit 275deea

Browse files
committed
remove platform-specific behaviour; improve comments, invert negative conditional
1 parent 5455902 commit 275deea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/MainGenericRunner.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ object MainGenericRunner {
106106
process(tail, settings.withExecuteMode(ExecuteMode.Run).withTargetToRun(fqName))
107107
case ("-cp" | "-classpath" | "--class-path") :: cp :: tail =>
108108
val globdir = cp.replaceAll("[\\\\/][^\\\\/]*$", "") // slash/backslash agnostic
109-
val (tailargs, cpstr) = if globdir.nonEmpty && classpathSeparator != ";" || cp.contains(classpathSeparator) then
110-
(tail, cp)
111-
else
112-
// combine globbed classpath entries into a classpath
109+
val (tailargs, cpstr) = if globdir.nonEmpty && !cp.contains(classpathSeparator) then
110+
// globdir is wildcard directory for globbed jar files, reconstruct the intended classpath
113111
val jarfiles = cp :: tail
114112
val cpfiles = jarfiles.takeWhile( f => f.startsWith(globdir) && ((f.toLowerCase.endsWith(".jar") || f.endsWith(".zip"))) )
115113
val tailargs = jarfiles.drop(cpfiles.size)
116114
(tailargs, cpfiles.mkString(classpathSeparator))
115+
else
116+
(tail, cp)
117117

118118
process(tailargs, settings.copy(classPath = settings.classPath ++ cpstr.split(classpathSeparator).filter(_.nonEmpty)))
119119

0 commit comments

Comments
 (0)