Skip to content

Commit af56abc

Browse files
authored
Merge pull request #10123 from som-snytt/dev/814-window-cmd-escapes
2 parents 7e844a5 + fbd7223 commit af56abc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/compiler/scala/tools/nsc/CompilerCommand.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
126126
def expandArg(arg: String): List[String] = {
127127
import java.nio.file.{Files, Paths}
128128
import scala.jdk.CollectionConverters._
129-
def stripComment(s: String) = s.takeWhile(_ != '#')
130-
val file = Paths.get(arg stripPrefix "@")
129+
def stripComment(s: String) = s.takeWhile(_ != '#').trim()
130+
val file = Paths.get(arg.stripPrefix("@"))
131131
if (!Files.exists(file))
132132
throw new java.io.FileNotFoundException(s"argument file $file could not be found")
133-
settings.splitParams(Files.readAllLines(file).asScala.map(stripComment).mkString(" "))
133+
Files.readAllLines(file).asScala.map(stripComment).filter(_ != "").toList
134134
}
135135

136136
// override this if you don't want arguments processed here

src/compiler/scala/tools/nsc/settings/MutableSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,5 +973,5 @@ class MutableSettings(val errorFn: String => Unit, val pathFactory: PathFactory)
973973
}
974974

975975
private object Optionlike {
976-
def unapply(s: String): Boolean = s.startsWith("-")
976+
def unapply(s: String): Boolean = s.startsWith("-") && s != "-"
977977
}

0 commit comments

Comments
 (0)