Skip to content

Commit

Permalink
Fix printing of some default types.
Browse files Browse the repository at this point in the history
When a certain default type is used and we don't have a default value
now check to see if the value is set and if so print the item.
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent 4b3d539 commit c6c9f96
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/lib/res.c
Expand Up @@ -1402,6 +1402,41 @@ bool BRSRES::print_config(POOL_MEM &buff)
default:
break;
}
} else {
switch (items[i].type) {
case CFG_TYPE_STR:
case CFG_TYPE_DIR:
case CFG_TYPE_NAME:
case CFG_TYPE_STRNAME:
print_item = *(items[i].value) != NULL;
break;
case CFG_TYPE_INT32:
print_item = (*(items[i].i32value) > 0);
break;
case CFG_TYPE_PINT32:
print_item = (*(items[i].ui32value) > 0);
break;
case CFG_TYPE_INT64:
print_item = (*(items[i].i64value) > 0);
break;
case CFG_TYPE_SPEED:
print_item = (*(items[i].ui64value) > 0);
break;
case CFG_TYPE_SIZE64:
print_item = (*(items[i].ui64value) > 0);
break;
case CFG_TYPE_SIZE32:
print_item = (*(items[i].ui32value) > 0);
break;
case CFG_TYPE_TIME:
print_item = (*(items[i].ui64value) > 0);
break;
case CFG_TYPE_BOOL:
print_item = (*items[i].boolvalue != false);
break;
default:
break;
}
}

switch (items[i].type) {
Expand Down

0 comments on commit c6c9f96

Please sign in to comment.