diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc index 4e44fa721f9..5f6a08cfe0f 100644 --- a/src/libexpr/print.cc +++ b/src/libexpr/print.cc @@ -163,7 +163,7 @@ class Printer EvalState & state; PrintOptions options; std::optional seen; - size_t attrsPrinted = 0; + size_t totalAttrsPrinted = 0; size_t listItemsPrinted = 0; std::string indent; @@ -350,7 +350,7 @@ class Printer for (auto & i : sorted) { printSpace(prettyPrint); - if (attrsPrinted >= options.maxAttrs) { + if (totalAttrsPrinted >= options.maxAttrs) { printElided(sorted.size() - currentAttrsPrinted, "attribute", "attributes"); break; } @@ -359,7 +359,7 @@ class Printer output << " = "; print(*i.second, depth + 1); output << ";"; - attrsPrinted++; + totalAttrsPrinted++; currentAttrsPrinted++; } @@ -591,7 +591,7 @@ class Printer void print(Value & v) { - attrsPrinted = 0; + totalAttrsPrinted = 0; listItemsPrinted = 0; indent.clear();