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 18664b8c1..8a2ea7974 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -992,7 +992,7 @@ static void showfiles(void) | |||
992 | 992 | ||
993 | /* find the longest file name - use that as the column width */ | 993 | /* find the longest file name - use that as the column width */ |
994 | for (row = 0; row < nrows; row++) { | 994 | for (row = 0; row < nrows; row++) { |
995 | l = unicode_strlen(matches[row]); | 995 | l = unicode_strwidth(matches[row]); |
996 | if (column_width < l) | 996 | if (column_width < l) |
997 | column_width = l; | 997 | column_width = l; |
998 | } | 998 | } |
@@ -1012,10 +1012,13 @@ static void showfiles(void) | |||
1012 | 1012 | ||
1013 | for (nc = 1; nc < ncols && n+nrows < nfiles; n += nrows, nc++) { | 1013 | for (nc = 1; nc < ncols && n+nrows < nfiles; n += nrows, nc++) { |
1014 | printf("%s%-*s", matches[n], | 1014 | printf("%s%-*s", matches[n], |
1015 | (int)(column_width - unicode_strlen(matches[n])), "" | 1015 | (int)(column_width - unicode_strwidth(matches[n])), "" |
1016 | ); | 1016 | ); |
1017 | } | 1017 | } |
1018 | puts(matches[n]); | 1018 | if (ENABLE_UNICODE_SUPPORT) |
1019 | puts(printable_string(NULL, matches[n])); | ||
1020 | else | ||
1021 | puts(matches[n]); | ||
1019 | } | 1022 | } |
1020 | } | 1023 | } |
1021 | 1024 | ||