about summary refs log tree commit diff
diff options
context:
space:
mode:
authorScott Olson <scott@solson.me>2016-02-24T00·30-0600
committerScott Olson <scott@solson.me>2016-02-24T00·30-0600
commit38816759fc7f70605ecfd73304b9d442db388b78 (patch)
tree6209da05d615045d0aee74afa0e8168cf57968bc
parent87e6649fc30a37adabf384a68f588de946bc3468 (diff)
Ignore blank inputs.
Previously, nix-repl would consider this an incomplete parse and wait for the
next line as if it was a multiline input.

Blank lines in the middle of a multiline input will continue to work.
-rw-r--r--nix-repl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/nix-repl.cc b/nix-repl.cc
index 1cdff20fd41d..6f4287a2b698 100644
--- a/nix-repl.cc
+++ b/nix-repl.cc
@@ -106,7 +106,7 @@ void NixRepl::mainLoop(const Strings & files)
         }
 
         try {
-            if (!processLine(input)) return;
+            if (!removeWhitespace(input).empty() && !processLine(input)) return;
         } catch (ParseError & e) {
             if (e.msg().find("unexpected $end") != std::string::npos) {
                 // For parse errors on incomplete input, we continue waiting for the next line of