* scols_table_new_column:
* @tb: table
* @name: column header
- * @whint: column width hint (absolute width: N > 1; relative width: N < 1)
+ * @whint: column width hint (absolute width: N > 1; relative width: 0 < N < 1)
* @flags: flags integer
*
* This is shortcut for
*
* The column width is possible to define by:
*
- * @whint = 0..1 : relative width, percent of terminal width
+ * @whint: 0 < N < 1 : relative width, percent of terminal width
*
- * @whint = 1..N : absolute width, empty column will be truncated to
+ * @whint: N >= 1 : absolute width, empty column will be truncated to
* the column header width if no specified STRICTWIDTH flag
*
* Note that if table has disabled "maxout" flag (disabled by default) than
case 1:
if (!trunc_flag) /* ignore: missing flag */
break;
- if (cl->width_hint >= 1) /* ignore: no relative */
+ if (cl->width_hint <= 0 || cl->width_hint >= 1) /* ignore: no relative */
break;
if (cl->width < (size_t) (cl->width_hint * tb->termwidth)) /* ignore: smaller than expected width */
break;
/* #3 stage - trunc relative without flag */
case 3:
- if (cl->width_hint >= 1) /* ignore: no relative */
+ if (cl->width_hint <= 0 || cl->width_hint >= 1) /* ignore: no relative */
break;
DBG(TAB, ul_debugobj(tb, " reducing (relative without flag)"));