about summary refs log tree commit diff
path: root/third_party/nix/src/nix/search.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/nix/search.cc')
-rw-r--r--third_party/nix/src/nix/search.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/third_party/nix/src/nix/search.cc b/third_party/nix/src/nix/search.cc
index 169daf7a32..97c5122d60 100644
--- a/third_party/nix/src/nix/search.cc
+++ b/third_party/nix/src/nix/search.cc
@@ -175,7 +175,8 @@ struct CmdSearch : SourceExprCommand, MixJSON {
           if (!toplevel) {
             auto attrs = v->attrs;
             Bindings::iterator j = attrs->find(sRecurse);
-            if (j == attrs->end() || !state->forceBool(*j->value, *j->pos)) {
+            if (j == attrs->end() ||
+                !state->forceBool(*j->second.value, *j->second.pos)) {
               DLOG(INFO) << "skip attribute '" << attrPath << "'";
               return;
             }
@@ -184,18 +185,19 @@ struct CmdSearch : SourceExprCommand, MixJSON {
           bool toplevel2 = false;
           if (!fromCache) {
             Bindings::iterator j = v->attrs->find(sToplevel);
-            toplevel2 =
-                j != v->attrs->end() && state->forceBool(*j->value, *j->pos);
+            toplevel2 = j != v->attrs->end() &&
+                        state->forceBool(*j->second.value, *j->second.pos);
           }
 
           for (auto& i : *v->attrs) {
             auto cache2 =
                 cache != nullptr
-                    ? std::make_unique<JSONObject>(cache->object(i.name))
+                    ? std::make_unique<JSONObject>(cache->object(i.second.name))
                     : nullptr;
-            doExpr(i.value,
-                   attrPath.empty() ? (std::string)i.name
-                                    : attrPath + "." + (std::string)i.name,
+            doExpr(i.second.value,
+                   attrPath.empty()
+                       ? (std::string)i.second.name
+                       : attrPath + "." + (std::string)i.second.name,
                    toplevel2 || fromCache, cache2 ? cache2.get() : nullptr);
           }
         }