summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2006-11-29 11:12:12 +0000
committerLex Spoon <lex@lexspoon.org>2006-11-29 11:12:12 +0000
commitc50a0d2295e6272b8e5209d485ed71fd6f24c8be (patch)
treed9e5356717ae0464ab39e8dce7fbbe46a909d420
parent6981bc62d7039efdcd07402287a6a07674c85b93 (diff)
downloadscala-c50a0d2295e6272b8e5209d485ed71fd6f24c8be.tar.gz
scala-c50a0d2295e6272b8e5209d485ed71fd6f24c8be.tar.bz2
scala-c50a0d2295e6272b8e5209d485ed71fd6f24c8be.zip
Be careful to use "." as the default user class...
Be careful to use "." as the default user classpath, even if scala.home is not set.
-rw-r--r--src/compiler/scala/tools/nsc/MainGenericRunner.scala29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/compiler/scala/tools/nsc/MainGenericRunner.scala b/src/compiler/scala/tools/nsc/MainGenericRunner.scala
index ef70977a86..056113d63a 100644
--- a/src/compiler/scala/tools/nsc/MainGenericRunner.scala
+++ b/src/compiler/scala/tools/nsc/MainGenericRunner.scala
@@ -23,24 +23,27 @@ object MainGenericRunner {
*/
def addClasspathExtras(classpath: String): String = {
val scalaHome = getProperty("scala.home")
- if (scalaHome eq null)
- return classpath
- val libdir = new File(new File(scalaHome), "lib")
- if(!libdir.exists || libdir.isFile)
- return classpath
+ val extraClassPath =
+ if (scalaHome eq null)
+ ""
+ else {
+ val libdir = new File(new File(scalaHome), "lib")
+ if(!libdir.exists || libdir.isFile)
+ return classpath
- val filesInLib = libdir.listFiles
- val jarsInLib =
- filesInLib.filter(f =>
- f.isFile && f.getName.endsWith(".jar"))
- val sep = File.pathSeparator
- val extraClassPath = jarsInLib.mkString("", sep, "")
+ val filesInLib = libdir.listFiles
+ val jarsInLib =
+ filesInLib.filter(f =>
+ f.isFile && f.getName.endsWith(".jar"))
+
+ jarsInLib.mkString("", File.pathSeparator, "")
+ }
if(classpath == "")
- extraClassPath + sep + "."
+ extraClassPath + File.pathSeparator + "."
else
- classpath + sep + extraClassPath
+ classpath + File.pathSeparator + extraClassPath
}
def main(args: Array[String]): Unit = {