aboutsummaryrefslogtreecommitdiff
path: root/coreutils/df.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-30 23:16:21 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-30 23:16:21 +0100
commite17764c8fb566f85020217dd8fd05fb6bc227e98 (patch)
treecf0a42cc23cd4aae92e69924087610a941c712a4 /coreutils/df.c
parentecd90fd488cd0c519070656f5cfa0b0959979be9 (diff)
downloadbusybox-e17764c8fb566f85020217dd8fd05fb6bc227e98.tar.gz
further work on unicodization
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/df.c')
-rw-r--r--coreutils/df.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/coreutils/df.c b/coreutils/df.c
index ae68f0831..4b23faa7a 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -114,9 +114,6 @@ int df_main(int argc UNUSED_PARAM, char **argv)
while (1) {
const char *device;
const char *mount_point;
-#if ENABLE_FEATURE_ASSUME_UNICODE
- size_t dev_len;
-#endif
if (mount_table) {
mount_entry = getmntent(mount_table);
@@ -178,11 +175,15 @@ int df_main(int argc UNUSED_PARAM, char **argv)
#endif
#if ENABLE_FEATURE_ASSUME_UNICODE
- dev_len = unicode_strlen(device);
- if (dev_len > 20) {
- printf("%s\n%20s", device, "");
- } else {
- printf("%s%*s", device, 20 - (int)dev_len, "");
+ {
+ uni_stat_t uni_stat;
+ char *uni_dev = unicode_conv_to_printable(&uni_stat, device);
+ if (uni_stat.unicode_width > 20) {
+ printf("%s\n%20s", uni_dev, "");
+ } else {
+ printf("%s%*s", uni_dev, 20 - (int)uni_stat.unicode_width, "");
+ }
+ free(uni_dev);
}
#else
if (printf("\n%-20s" + 1, device) > 20)