summaryrefslogtreecommitdiffstats
path: root/libsmartcols/src/table.c
diff options
context:
space:
mode:
authorKarel Zak2016-01-07 17:29:11 +0100
committerKarel Zak2016-01-07 17:36:44 +0100
commit19981b07d97667686135b491162d241a93ad3f75 (patch)
tree92f36427610a817cc421a5961d2bbbca874e4714 /libsmartcols/src/table.c
parenthwclock: change audit message (diff)
downloadkernel-qcow2-util-linux-19981b07d97667686135b491162d241a93ad3f75.tar.gz
kernel-qcow2-util-linux-19981b07d97667686135b491162d241a93ad3f75.tar.xz
kernel-qcow2-util-linux-19981b07d97667686135b491162d241a93ad3f75.zip
libsmartcols: make output buffer size estimation more robust and elegant
Reported-by: Andreas Henriksson <andreas@fatal.se> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libsmartcols/src/table.c')
-rw-r--r--libsmartcols/src/table.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libsmartcols/src/table.c b/libsmartcols/src/table.c
index a9beab122..cb4cfae0d 100644
--- a/libsmartcols/src/table.c
+++ b/libsmartcols/src/table.c
@@ -362,7 +362,11 @@ FILE *scols_table_get_stream(struct libscols_table *tb)
* @tb: table
* @reduce: width
*
- * Reduce the output width to @reduce.
+ * If necessary then libsmartcols use all terminal width, the @reduce setting
+ * provides extra space (for example for borders in ncurses applications).
+ *
+ * The @reduce must be smaller than terminal width, otherwise it's sillently
+ * ignored. The reduction is not applied when STDOUT_FILENO is not terminal.
*
* Returns: 0, a negative value in case of an error.
*/