diff --git a/.gitignore b/.gitignore index 9c28f11..0ee17cf 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,7 @@ lib/uniwidth.h lib/warn-on-use.h lib/wchar.h lib/wctype.h +lib/uchar.h man/*.1 po/*.gmo po/*.po diff --git a/bootstrap.conf b/bootstrap.conf index 2560846..4b3f02d 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -24,11 +24,11 @@ avoided_gnulib_modules=' # gnulib modules used by this package. gnulib_modules=' announce-gen -attribute argmatch +attribute binary-io -nullptr c-stack +c32width config-h count-leading-zeros diffseq @@ -40,10 +40,10 @@ exclude exitfail extensions extern-inline -flexmember fcntl file-type filenamecat +flexmember fnmatch-gnu getopt-gnu gettext-h @@ -65,12 +65,13 @@ largefile lstat maintainer-makefile manywarnings -mbrtowc +mbrtoc32 mempcpy minmax mkstemp mktime nstrftime +nullptr perl progname propername-lite @@ -101,7 +102,6 @@ update-copyright verify version-etc version-etc-fsf -wcwidth xalloc xfreopen xmalloca diff --git a/src/side.c b/src/side.c index c4042dd..424d933 100644 --- a/src/side.c +++ b/src/side.c @@ -22,7 +22,7 @@ #include "diff.h" -#include +#include static void print_sdiff_common_lines (lin, lin); static void print_sdiff_hunk (struct change *); @@ -135,12 +135,12 @@ print_half_line (char const *const *line, intmax_t indent, intmax_t out_bound) default: { - wchar_t wc; - size_t bytes = mbrtowc (&wc, tp0, text_limit - tp0, &mbstate); + char32_t wc; + size_t bytes = mbrtoc32 (&wc, tp0, text_limit - tp0, &mbstate); if (0 < bytes && bytes < (size_t) -2) { - int width = wcwidth (wc); + int width = c32width (wc); if (0 < width) in_position += width; if (in_position <= out_bound)