aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-01-02 07:25:47 +0000
committerEric Andersen <andersen@codepoet.org>2003-01-02 07:25:47 +0000
commit2c24bb80f9f2e226f212c48d600bdf64956fc972 (patch)
tree9589cdacc907e0bfdd8e05ae69b81bb240c2a248
parent7ce75f44ae8cfb419adca01593eb5b055ccc4b16 (diff)
downloadbusybox-2c24bb80f9f2e226f212c48d600bdf64956fc972.tar.gz
Fix tab-tab listing of files so it properly reflects current
terminal width. -Erik
-rw-r--r--shell/cmdedit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 2e102e351..da2b017e1 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -1088,14 +1088,13 @@ static void input_tab(int *lastWasTab)
if (l < 14)
l = 14;
printf("%-14s ", matches[i]);
+ col+=l;
if ((l += 2) > 16)
while (l % 16) {
putchar(' ');
l++;
}
- col += l;
- col -= (col / cmdedit_termw) * cmdedit_termw;
- if (col > 60 && matches[i + 1] != NULL) {
+ if (col > (cmdedit_termw-l-l) && matches[i + 1] != NULL) {
putchar('\n');
col = 0;
}