about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 81abe5b618a5..b6b69c2bdbf5 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -153,7 +153,7 @@ static Symbol getName(const AttrName & name, EvalState & state, Env & env)
 }
 
 
-EvalState::EvalState()
+EvalState::EvalState(const Strings & _searchPath)
     : sWith(symbols.create("<with>"))
     , sOutPath(symbols.create("outPath"))
     , sDrvPath(symbols.create("drvPath"))
@@ -219,11 +219,10 @@ EvalState::EvalState()
 #endif
 
     /* Initialise the Nix expression search path. */
-    searchPathInsertionPoint = searchPath.end();
     Strings paths = tokenizeString<Strings>(getEnv("NIX_PATH", ""), ":");
-    foreach (Strings::iterator, i, paths) addToSearchPath(*i);
+    for (auto & i : _searchPath) addToSearchPath(i);
+    for (auto & i : paths) addToSearchPath(i);
     addToSearchPath("nix=" + settings.nixDataDir + "/nix/corepkgs");
-    searchPathInsertionPoint = searchPath.begin();
 
     createBaseEnv();
 }