Fixup tabs with dynamic Columns - add missing `Dynamic()`

This commit is contained in:
Sohaib Mohamed 2021-10-18 17:55:54 +11:00 committed by Nathan Scott
parent 31fe29c5a7
commit cd6457ef88
1 changed files with 4 additions and 1 deletions

View File

@ -491,9 +491,12 @@ static bool Settings_read(Settings* this, const char* fileName, unsigned int ini
static void writeFields(FILE* fd, const ProcessField* fields, Hashtable* columns, bool byName, char separator) {
const char* sep = "";
for (unsigned int i = 0; fields[i]; i++) {
if (fields[i] >= LAST_PROCESSFIELD || byName) {
if (fields[i] < LAST_PROCESSFIELD && byName) {
const char* pName = toFieldName(columns, fields[i]);
fprintf(fd, "%s%s", sep, pName);
} else if(fields[i] >= LAST_PROCESSFIELD && byName) {
const char* pName = toFieldName(columns, fields[i]);
fprintf(fd, " Dynamic(%s)", pName);
} else {
// This "-1" is for compatibility with the older enum format.
fprintf(fd, "%s%d", sep, (int) fields[i] - 1);