diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-01-02 07:25:47 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-01-02 07:25:47 +0000 |
commit | 2c24bb80f9f2e226f212c48d600bdf64956fc972 (patch) | |
tree | 9589cdacc907e0bfdd8e05ae69b81bb240c2a248 /shell | |
parent | 7ce75f44ae8cfb419adca01593eb5b055ccc4b16 (diff) | |
download | busybox-w32-2c24bb80f9f2e226f212c48d600bdf64956fc972.tar.gz busybox-w32-2c24bb80f9f2e226f212c48d600bdf64956fc972.tar.bz2 busybox-w32-2c24bb80f9f2e226f212c48d600bdf64956fc972.zip |
Fix tab-tab listing of files so it properly reflects current
terminal width.
-Erik
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cmdedit.c | 5 |
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) | |||
1088 | if (l < 14) | 1088 | if (l < 14) |
1089 | l = 14; | 1089 | l = 14; |
1090 | printf("%-14s ", matches[i]); | 1090 | printf("%-14s ", matches[i]); |
1091 | col+=l; | ||
1091 | if ((l += 2) > 16) | 1092 | if ((l += 2) > 16) |
1092 | while (l % 16) { | 1093 | while (l % 16) { |
1093 | putchar(' '); | 1094 | putchar(' '); |
1094 | l++; | 1095 | l++; |
1095 | } | 1096 | } |
1096 | col += l; | 1097 | if (col > (cmdedit_termw-l-l) && matches[i + 1] != NULL) { |
1097 | col -= (col / cmdedit_termw) * cmdedit_termw; | ||
1098 | if (col > 60 && matches[i + 1] != NULL) { | ||
1099 | putchar('\n'); | 1098 | putchar('\n'); |
1100 | col = 0; | 1099 | col = 0; |
1101 | } | 1100 | } |