]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/table.c
Xtype docs: Fixed a typo
[libucw.git] / ucw / table.c
index b00979c207057d702eafabe8d6fb2dd6aed80969..1324839a7c371fd59e1097e09e7724faae437b1e 100644 (file)
@@ -215,10 +215,10 @@ const char *table_set_col_opt(struct table *tbl, uint col_inst_idx, const char *
     return col_def->set_col_opt(tbl, col_inst_idx, col_opt);
   }
 
-  if(col_def && col_def->type_def && col_def->type_def->parse_fmt) {
-    uint fmt = 0;
-    const char *tmp_err = col_def->type_def->parse_fmt(col_opt, &fmt, tbl->pool);
-    if(tmp_err) return tmp_err;
+  if(col_def && col_def->type_def) {
+    u32 fmt = 0;
+    const char *tmp_err = xtype_parse_fmt(col_def->type_def, col_opt, &fmt, tbl->pool);
+    if(tmp_err) return mp_printf(tbl->pool, "Invalid column format; xtypes error: '%s'.", tmp_err);
     tbl->column_order[col_inst_idx].fmt = fmt;
     return NULL;
   }
@@ -250,11 +250,13 @@ static char **table_parse_col_arg2(char *col_def)
     if(*next == 0) break;
     *next = 0;
     next++;
-    *GARY_PUSH(result) = col_opt;
+    if(*col_opt)
+      *GARY_PUSH(result) = col_opt;
 
     col_opt = next;
   }
-  *GARY_PUSH(result) = col_opt;
+  if(*col_opt)
+    *GARY_PUSH(result) = col_opt;
 
   return result;
 }