Add the ability to catch and do the right thing with Interrupts (often control-c)
and end-of-file (often control-d).



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119837 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectExpression.cpp b/source/Commands/CommandObjectExpression.cpp
index 436b2e7..32236f8 100644
--- a/source/Commands/CommandObjectExpression.cpp
+++ b/source/Commands/CommandObjectExpression.cpp
@@ -199,7 +199,18 @@
         //    ::fprintf (out_fh, "%3u: ", cmd_object_expr->m_expr_line_count);
         break;
         
+    case eInputReaderInterrupt:
+        cmd_object_expr->m_expr_lines.clear();
+        reader.SetIsDone (true);
+        reader.GetDebugger().GetOutputStream().Printf("%s\n", "Expression evaluation cancelled.");
+        break;
+        
+    case eInputReaderEndOfFile:
+        reader.SetIsDone (true);
+        break;
+        
     case eInputReaderDone:
+		if (cmd_object_expr->m_expr_lines.size() > 0)
         {
             cmd_object_expr->EvaluateExpression (cmd_object_expr->m_expr_lines.c_str(), 
                                                  reader.GetDebugger().GetOutputStream(),