From: Gunnar Beutner Date: Wed, 4 Nov 2015 16:06:33 +0000 (+0100) Subject: Improve formatting for arrays X-Git-Tag: v2.4.0~94 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe1c5e9507655a227452daaf2081126883429d50;p=icinga2 Improve formatting for arrays refs #10527 --- diff --git a/lib/base/configwriter.cpp b/lib/base/configwriter.cpp index 737305eac..eac3ca7b9 100644 --- a/lib/base/configwriter.cpp +++ b/lib/base/configwriter.cpp @@ -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)