BPackageInfo::StringBuilder: Fix writing non-string lists

Even a list with only one element needs to be enclosed in {...}.
This commit is contained in:
Ingo Weinhold 2013-10-30 01:51:23 +01:00
parent 79d29839bf
commit 690bccd46a

View File

@ -130,21 +130,16 @@ private:
// encapsulating the stringification via templates seems to result in
// an Internal Compiler Error with gcc 2.
_Write("{\n", 2);
int32 count = value.CountItems();
if (count == 1) {
_WriteListElement(value.ItemAt(0));
} else {
_Write("{\n", 2);
int32 count = value.CountItems();
for (int32 i = 0; i < count; i++) {
_Write('\t');
_WriteListElement(value.ItemAt(i));
_Write('\n');
}
_Write('}');
for (int32 i = 0; i < count; i++) {
_Write('\t');
_WriteListElement(value.ItemAt(i));
_Write('\n');
}
_Write('}');
}
template<typename Value>