summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-26 15:48:59 +0000
committerPaul Phillips <paulp@improving.org>2011-07-26 15:48:59 +0000
commit1034ca2b031ba3845ba87162eed801fefc811ad4 (patch)
treee9c8b55b826046d1c786c5117848417f7ccfe113
parent544ad5df3b77a8ab4ded924d903784f1e05f4e73 (diff)
downloadscala-1034ca2b031ba3845ba87162eed801fefc811ad4.tar.gz
scala-1034ca2b031ba3845ba87162eed801fefc811ad4.tar.bz2
scala-1034ca2b031ba3845ba87162eed801fefc811ad4.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.scala9
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 a1ddb10b5f..66e99348dd 100644
--- a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
@@ -49,6 +49,13 @@ class MutableSettings(val errorFn: String => Unit) extends AbsSettings with Scal
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)
@@ -59,7 +66,7 @@ class MutableSettings(val errorFn: String => Unit) extends AbsSettings with Scal
else (checkDependencies, args)
}
}
- loop(arguments filterNot (_ == ""), Nil)
+ loop(arguments, Nil)
}
def processArgumentString(params: String) = processArguments(splitParams(params), true)