← Commit list

22bb81fa8

Michael Tokarev
Michael Tokarev
2013-12-16
SUCCESS Duration: 217s

Subject

expand: use printable_string instead of hard-coding implementation

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/expand.c+3 -10
@@ -78,11 +78,7 @@ static void expand(FILE *file, unsigned tab_size, unsigned opt)
unsigned len;
*ptr = '\0';
# if ENABLE_UNICODE_SUPPORT
- {
- uni_stat_t uni_stat;
- printable_string(&uni_stat, ptr_strbeg);
- len = uni_stat.unicode_width;
- }
+ len = unicode_strwidth(ptr_strbeg);
# else
len = ptr - ptr_strbeg;
# endif
@@ -138,12 +134,9 @@ static void unexpand(FILE *file, unsigned tab_size, unsigned opt)
printf("%*s%.*s", len, "", n, ptr);
# if ENABLE_UNICODE_SUPPORT
{
- char c;
- uni_stat_t uni_stat;
- c = ptr[n];
+ char c = ptr[n];
ptr[n] = '\0';
- printable_string(&uni_stat, ptr);
- len = uni_stat.unicode_width;
+ len = unicode_strwidth(ptr);
ptr[n] = c;
}
# else