about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-28T15·47-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-28T15·47-0400
commitf7b650d234dffd72b2c70ee25d9e333d433feba6 (patch)
tree134389785d2428d8b74ccc32db8c40d5cd1d8140
parent15e1b2c223494ecb5efefc3ea0e3b926a6b1d7dc (diff)
Make "nix-instantiate -" interruptible
-rw-r--r--src/nix-instantiate/nix-instantiate.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index beb7fa024959..6ddf9f069ef3 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -26,9 +26,7 @@ void printHelp()
 static Expr * parseStdin(EvalState & state)
 {
     startNest(nest, lvlTalkative, format("parsing standard input"));
-    string s, s2;
-    while (getline(std::cin, s2)) s += s2 + "\n";
-    return state.parseExprFromString(s, absPath("."));
+    return state.parseExprFromString(drainFD(0), absPath("."));
 }