summaryrefslogtreecommitdiffstats
path: root/disk-utils/cfdisk.c
diff options
context:
space:
mode:
authorKarel Zak2015-12-07 10:42:15 +0100
committerKarel Zak2015-12-07 10:42:15 +0100
commit86688c378b7b3bebfd145561ad252c4247cc44c1 (patch)
tree3893e9c4b348091ce017f7bbff17b6a191f013d0 /disk-utils/cfdisk.c
parentlsns: improve formatting and wording of the man page (diff)
downloadkernel-qcow2-util-linux-86688c378b7b3bebfd145561ad252c4247cc44c1.tar.gz
kernel-qcow2-util-linux-86688c378b7b3bebfd145561ad252c4247cc44c1.tar.xz
kernel-qcow2-util-linux-86688c378b7b3bebfd145561ad252c4247cc44c1.zip
Revert "cfdisk: make sure that output fits to terminal width"
This reverts commit ed99eac0e2a83a315c7cf5d8a461df16b3106596.
Diffstat (limited to 'disk-utils/cfdisk.c')
-rw-r--r--disk-utils/cfdisk.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index 8b34107ca..a370a1318 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -497,23 +497,12 @@ static int lines_refresh(struct cfdisk *cf)
cf->lines = xcalloc(cf->nlines, sizeof(struct cfdisk_line));
for (p = cf->linesbuf, i = 0; p && i < cf->nlines; i++) {
- char *begin = p;
- size_t sz;
-
- cf->lines[i].data = begin;
- p = strchr(begin, '\n');
- sz = p ? (size_t) (p - begin) : strlen(begin);
+ cf->lines[i].data = p;
+ p = strchr(p, '\n');
if (p) {
*p = '\0';
p++;
}
- /* libsmartcols reduces columns width as much as possible to
- * fit terminal width, but for very small terminals it preffers
- * long lines rather than remove columns from output. This is fine
- * for normal utils, but it's problematic for ncurses -- so we
- * manually cut the end of the line to fit terminal width. */
- if (sz + ARROW_CURSOR_WIDTH > ui_cols)
- *(begin + (ui_cols - ARROW_CURSOR_WIDTH)) = '\0';
cf->lines[i].extra = scols_new_table();
scols_table_enable_noheadings(cf->lines[i].extra, 1);
scols_table_new_column(cf->lines[i].extra, NULL, 0, SCOLS_FL_RIGHT);