diff options
-rw-r--r-- | coreutils/expand.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/coreutils/expand.c b/coreutils/expand.c index 2f6a708b5..60ac9f568 100644 --- a/coreutils/expand.c +++ b/coreutils/expand.c | |||
@@ -49,7 +49,11 @@ static void expand(FILE *file, unsigned tab_size, unsigned opt) | |||
49 | unsigned len; | 49 | unsigned len; |
50 | *ptr = '\0'; | 50 | *ptr = '\0'; |
51 | # if ENABLE_FEATURE_ASSUME_UNICODE | 51 | # if ENABLE_FEATURE_ASSUME_UNICODE |
52 | len = unicode_strlen(ptr_strbeg); | 52 | { |
53 | uni_stat_t uni_stat; | ||
54 | printable_string(&uni_stat, ptr_strbeg); | ||
55 | len = uni_stat.unicode_width; | ||
56 | } | ||
53 | # else | 57 | # else |
54 | len = ptr - ptr_strbeg; | 58 | len = ptr - ptr_strbeg; |
55 | # endif | 59 | # endif |
@@ -103,9 +107,11 @@ static void unexpand(FILE *file, unsigned tab_size, unsigned opt) | |||
103 | # if ENABLE_FEATURE_ASSUME_UNICODE | 107 | # if ENABLE_FEATURE_ASSUME_UNICODE |
104 | { | 108 | { |
105 | char c; | 109 | char c; |
110 | uni_stat_t uni_stat; | ||
106 | c = ptr[n]; | 111 | c = ptr[n]; |
107 | ptr[n] = '\0'; | 112 | ptr[n] = '\0'; |
108 | len = unicode_strlen(ptr); | 113 | printable_string(&uni_stat, ptr); |
114 | len = uni_stat.unicode_width; | ||
109 | ptr[n] = c; | 115 | ptr[n] = c; |
110 | } | 116 | } |
111 | # else | 117 | # else |