diff options
author | Paul Phillips <paulp@improving.org> | 2011-07-26 15:20:10 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-07-26 15:20:10 +0000 |
commit | 1ad15b1f50364dc42e06117bf551159adea25312 (patch) | |
tree | 441fd36e9192c625284602aeb14ed7ec4e83e7b2 | |
parent | 9f9af2ad4885af6257a01efcaabed526e7a64eda (diff) | |
download | scala-1ad15b1f50364dc42e06117bf551159adea25312.tar.gz scala-1ad15b1f50364dc42e06117bf551159adea25312.tar.bz2 scala-1ad15b1f50364dc42e06117bf551159adea25312.zip |
Discard empty strings in option position, but n...
Discard empty strings in option position, but not in argument position.
Closes SI-4782, no review.
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/MutableSettings.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala index d2a3cc6699..b96d9fbb1e 100644 --- a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala @@ -53,6 +53,13 @@ class MutableSettings(val errorFn: String => Unit) errorFn("bad option: '" + x + "'") (false, args) } + // discard empties, sometimes they appear because of ant or etc. + // but discard carefully, because an empty string is valid as an argument + // to an option, e.g. -cp "" . So we discard them only when they appear + // in option position. + else if (x == "") { + loop(xs, residualArgs) + } else lookupSetting(x) match { case Some(s) if s.shouldStopProcessing => (checkDependencies, newArgs) case _ => loop(newArgs, residualArgs) @@ -63,7 +70,7 @@ class MutableSettings(val errorFn: String => Unit) else (checkDependencies, args) } } - loop(arguments filterNot (_ == ""), Nil) + loop(arguments, Nil) } def processArgumentString(params: String) = processArguments(splitParams(params), true) |