about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-06T13·24+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-06T13·24+0100
commit5badc8f9758a0547b492ea0077e50c9ffd4f8424 (patch)
treede07cae8bbb7c10a34e5546d45ef1cb964a455c3 /src/libexpr/nixexpr.cc
parent9f3eb56b460ad14647b90f9fc841776daf9beb47 (diff)
Improve error message
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r--src/libexpr/nixexpr.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 50997e096fd1..43f3161f8baf 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -200,15 +200,12 @@ string showAttrPath(const AttrPath & attrPath)
 {
     std::ostringstream out;
     bool first = true;
-    foreach (AttrPath::const_iterator, i, attrPath) {
-        if (!first)
-            out << '.';
+    for (auto & i : attrPath) {
+        if (!first) out << '.'; else first = false;
+        if (i.symbol.set())
+            out << i.symbol;
         else
-            first = false;
-        if (i->symbol.set())
-            out << i->symbol;
-        else
-            out << "\"${" << *i->expr << "}\"";
+            out << "\"${" << *i.expr << "}\"";
     }
     return out.str();
 }