From 89679c303a41b2a40012c4ad49d6de2b0306b1af Mon Sep 17 00:00:00 2001 From: Robert Kessl Date: Tue, 22 Jul 2014 13:08:18 +0200 Subject: [PATCH] tableprinter: header option now parsed by xtypes --- ucw/table.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ucw/table.c b/ucw/table.c index 74ca5296..0c0294e5 100644 --- a/ucw/table.c +++ b/ucw/table.c @@ -387,12 +387,13 @@ const char *table_set_option_value(struct table *tbl, const char *key, const cha // Options with a value if(value) { if(strcmp(key, "header") == 0) { - if(value[1] != 0) - return mp_printf(tbl->pool, "Invalid header parameter: '%s' has invalid value: '%s'.", key, value); - uint tmp = value[0] - '0'; - if(tmp > 1) + bool tmp; + const char *err = xt_bool.parse(value, &tmp, tbl->pool); + if(err) return mp_printf(tbl->pool, "Invalid header parameter: '%s' has invalid value: '%s'.", key, value); + tbl->print_header = tmp; + return NULL; } else if(strcmp(key, "cols") == 0) { return table_set_col_order_by_name(tbl, value); -- 2.39.2