summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-07 01:37:40 +0000
committerPaul Phillips <paulp@improving.org>2010-12-07 01:37:40 +0000
commita8db7a2da783b0752aad1a738b0e5600c303e97e (patch)
tree14ed9e52093a3f8216cf28bec38e4a2301c97a04
parentd46e72721f578caaaf4d55060c0a1a9d531641e7 (diff)
downloadscala-a8db7a2da783b0752aad1a738b0e5600c303e97e.tar.gz
scala-a8db7a2da783b0752aad1a738b0e5600c303e97e.tar.bz2
scala-a8db7a2da783b0752aad1a738b0e5600c303e97e.zip
Hardened sigint handler against ctrl-C in the f...
Hardened sigint handler against ctrl-C in the first few seconds of startup. No review.
-rw-r--r--src/compiler/scala/tools/nsc/InterpreterLoop.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala
index 82b32fe219..0b344b3329 100644
--- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala
+++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala
@@ -118,7 +118,9 @@ class InterpreterLoop(in0: Option[BufferedReader], protected val out: PrintWrite
}
ignoring(classOf[Exception]) {
SignalManager("INT") = {
- if (interpreter.lineManager.running)
+ if (interpreter == null)
+ onExit()
+ else if (interpreter.lineManager.running)
interpreter.lineManager.cancel()
else if (in.currentLine != "") {
// non-empty buffer, so make them hit ctrl-C a second time