]> granicus.if.org Git - icinga2/commitdiff
Fixed indentation bug in Expression::DumpValue().
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 30 Jan 2013 22:15:37 +0000 (23:15 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 30 Jan 2013 22:15:37 +0000 (23:15 +0100)
lib/config/expression.cpp

index a8f74a74e0bede2653487b9416da84fbdfe0ed8f..71a9c8894f22ea42d7a654aa87e05f6392036757 100644 (file)
@@ -117,8 +117,6 @@ void Expression::DumpValue(ostream& fp, int indent, const Value& value, bool inl
                static_cast<ExpressionList::Ptr>(value)->Dump(fp, indent);
 
                if (!inlineDict) {
-                       fp << "\n";
-
                        for (int i = 0; i < indent - 1; i++)
                                fp << "\t";
 
@@ -135,13 +133,18 @@ void Expression::DumpValue(ostream& fp, int indent, const Value& value, bool inl
                String k;
                Value v;
                BOOST_FOREACH(tie(k, v), static_cast<Dictionary::Ptr>(value)) {
+                       for (int i = 0; i < indent; i++)
+                               fp << "\t";
+
                        fp << "\"" << k << "\" = ";
                        DumpValue(fp, indent, v);
                        fp << "," << "\n";
+
+                       fp << "}";
                }
 
                if (!inlineDict)
-                       fp << "\n" << "}";
+                       fp << "}";
 
                return;
        }