aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 12:32:22 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 12:32:22 +1000
commit035857cb1c5ea2956b5bc721992169e2571fc03b (patch)
tree0979c8c1cad4537232b6be352a4c8da6d96072fb /libbb/lineedit.c
parent29ab9e37d0dc05dc6e302437106800bf62748b05 (diff)
parent8837c5dec402fd6782589c0a676bc7f90dea4061 (diff)
downloadbusybox-w32-035857cb1c5ea2956b5bc721992169e2571fc03b.tar.gz
busybox-w32-035857cb1c5ea2956b5bc721992169e2571fc03b.tar.bz2
busybox-w32-035857cb1c5ea2956b5bc721992169e2571fc03b.zip
Merge branch 'origin/master' (early part)
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r--libbb/lineedit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index f7faf4639..ab418c0ab 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1000,7 +1000,7 @@ static void showfiles(void)
1000 1000
1001 /* find the longest file name - use that as the column width */ 1001 /* find the longest file name - use that as the column width */
1002 for (row = 0; row < nrows; row++) { 1002 for (row = 0; row < nrows; row++) {
1003 l = unicode_strlen(matches[row]); 1003 l = unicode_strwidth(matches[row]);
1004 if (column_width < l) 1004 if (column_width < l)
1005 column_width = l; 1005 column_width = l;
1006 } 1006 }
@@ -1020,10 +1020,13 @@ static void showfiles(void)
1020 1020
1021 for (nc = 1; nc < ncols && n+nrows < nfiles; n += nrows, nc++) { 1021 for (nc = 1; nc < ncols && n+nrows < nfiles; n += nrows, nc++) {
1022 printf("%s%-*s", matches[n], 1022 printf("%s%-*s", matches[n],
1023 (int)(column_width - unicode_strlen(matches[n])), "" 1023 (int)(column_width - unicode_strwidth(matches[n])), ""
1024 ); 1024 );
1025 } 1025 }
1026 puts(matches[n]); 1026 if (ENABLE_UNICODE_SUPPORT)
1027 puts(printable_string(NULL, matches[n]));
1028 else
1029 puts(matches[n]);
1027 } 1030 }
1028} 1031}
1029 1032