diff options
author | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-07-08 07:57:42 +0000 |
---|---|---|
committer | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-07-08 07:57:42 +0000 |
commit | bc5ef919c02ba95163f093e624dadbc17ae1bbdf (patch) | |
tree | c11b638943fb81bc7315f2a24436c8463dbebce2 /src | |
parent | 82fa132d6bf74589a925b1b4ae75113180dbd22a (diff) | |
download | scala-bc5ef919c02ba95163f093e624dadbc17ae1bbdf.tar.gz scala-bc5ef919c02ba95163f093e624dadbc17ae1bbdf.tar.bz2 scala-bc5ef919c02ba95163f093e624dadbc17ae1bbdf.zip |
Fixed r15497 to handle the case where a file th...
Fixed r15497 to handle the case where a file that doesn't end in
".scala" already exists.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/InterpreterLoop.scala | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala index af4b2052be..c0fcee0bc8 100644 --- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala +++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala @@ -197,13 +197,14 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) { out.println("That command requires a filename to be specified.") return () } - val name = command.substring(spaceIdx).trim - val filename = if(name.toLowerCase endsWith ".scala") name else (name + ".scala") - if (! new File(filename).exists) { + val filename = command.substring(spaceIdx).trim + if (new File(filename).exists) + action(filename) + else if (new File(filename + ".scala").exists) + action(filename + ".scala") + else { out.println("That file does not exist") - return () } - action(filename) } val helpRegexp = ":h(e(l(p)?)?)?" |