]> granicus.if.org Git - icinga2/commitdiff
Improve formatting for arrays
authorGunnar Beutner <gunnar@beutner.name>
Wed, 4 Nov 2015 16:06:33 +0000 (17:06 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 4 Nov 2015 16:06:33 +0000 (17:06 +0100)
refs #10527

lib/base/configwriter.cpp

index 737305eaca9091a9970fc053cc6e94dd35852c2c..eac3ca7b9650408f7554f68321fa2f366d21c28e 100644 (file)
@@ -54,7 +54,9 @@ void ConfigWriter::EmitArray(std::ostream& fp, int indentLevel, const Array::Ptr
 {
        fp << "[ ";
        EmitArrayItems(fp, indentLevel, val);
-       fp << " ]";
+       if (val->GetLength() > 0)
+               fp << " ";
+       fp << "]";
 }
 
 void ConfigWriter::EmitArrayItems(std::ostream& fp, int indentLevel, const Array::Ptr& val)