aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index 6faa9f9fa..910f0f694 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -205,6 +205,7 @@ void NixRepl::mainLoop(const std::vector<std::string> & files)
if (!files.empty()) {
for (auto & i : files)
loadedFiles.push_back(i);
+ }
reloadFiles();
if (!loadedFiles.empty()) notice("");
@@ -639,7 +640,7 @@ void NixRepl::addAttrsToScope(Value & attrs)
{
state->forceAttrs(attrs);
for (auto & i : *attrs.attrs)
- addVarToScope(i.name, *i.value);
+ addVarToScope(i.name, i.value);
notice("Added %1% variables.", attrs.attrs->size());
}
@@ -650,7 +651,7 @@ void NixRepl::addVarToScope(const Symbol & name, Value * v)
throw Error("environment full; cannot add more variables");
staticEnv->vars.emplace_back(name, displ);
staticEnv->sort();
- env->values[displ++] = &v;
+ env->values[displ++] = v;
varNames.insert((string) name);
}