diff options
-rw-r--r-- | coreutils/expand.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/coreutils/expand.c b/coreutils/expand.c index 25bbffc66..8d376ff4e 100644 --- a/coreutils/expand.c +++ b/coreutils/expand.c | |||
@@ -78,11 +78,7 @@ static void expand(FILE *file, unsigned tab_size, unsigned opt) | |||
78 | unsigned len; | 78 | unsigned len; |
79 | *ptr = '\0'; | 79 | *ptr = '\0'; |
80 | # if ENABLE_UNICODE_SUPPORT | 80 | # if ENABLE_UNICODE_SUPPORT |
81 | { | 81 | len = unicode_strwidth(ptr_strbeg); |
82 | uni_stat_t uni_stat; | ||
83 | printable_string(&uni_stat, ptr_strbeg); | ||
84 | len = uni_stat.unicode_width; | ||
85 | } | ||
86 | # else | 82 | # else |
87 | len = ptr - ptr_strbeg; | 83 | len = ptr - ptr_strbeg; |
88 | # endif | 84 | # endif |
@@ -138,12 +134,9 @@ static void unexpand(FILE *file, unsigned tab_size, unsigned opt) | |||
138 | printf("%*s%.*s", len, "", n, ptr); | 134 | printf("%*s%.*s", len, "", n, ptr); |
139 | # if ENABLE_UNICODE_SUPPORT | 135 | # if ENABLE_UNICODE_SUPPORT |
140 | { | 136 | { |
141 | char c; | 137 | char c = ptr[n]; |
142 | uni_stat_t uni_stat; | ||
143 | c = ptr[n]; | ||
144 | ptr[n] = '\0'; | 138 | ptr[n] = '\0'; |
145 | printable_string(&uni_stat, ptr); | 139 | len = unicode_strwidth(ptr); |
146 | len = uni_stat.unicode_width; | ||
147 | ptr[n] = c; | 140 | ptr[n] = c; |
148 | } | 141 | } |
149 | # else | 142 | # else |