display: don't cut off zero-width characters at the end of a chunk

This fixes https://savannah.gnu.org/bugs/?52258.
Reported-by: Peter Passchier <peter@passchier.net>
master
David Lawrence Ramsey 2017-10-23 14:20:25 -05:00 committed by Benno Schulenberg
parent 3018ab4706
commit d344c3d042
1 changed files with 1 additions and 1 deletions

View File

@ -1949,7 +1949,7 @@ char *display_string(const char *buf, size_t column, size_t span, bool isdata)
#endif
}
while (*buf != '\0' && column < beyond) {
while (*buf != '\0' && (column < beyond || mbwidth(buf) == 0)) {
int charlength, charwidth = 1;
if (*buf == ' ') {