diff options
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 9 |
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 | ||