X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/99848b37d2c3e14c0af45fc6da437a806aa58a80..6b985764f07ae164d8142ba64774f2beb2856ca8:/src/xdisp.c diff --git a/src/xdisp.c b/src/xdisp.c index e78d3d6f5b..d2f0d49d2b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -27342,18 +27342,21 @@ x_produce_glyphs (struct it *it) int leftmost, rightmost, lowest, highest; int lbearing, rbearing; int i, width, ascent, descent; - int c IF_LINT (= 0); /* cmp->glyph_len can't be zero; see Bug#8512 */ + int c; XChar2b char2b; struct font_metrics *pcm; ptrdiff_t pos; - for (glyph_len = cmp->glyph_len; glyph_len > 0; glyph_len--) - if ((c = COMPOSITION_GLYPH (cmp, glyph_len - 1)) != '\t') - break; + eassume (0 < glyph_len); /* See Bug#8512. */ + do + c = COMPOSITION_GLYPH (cmp, --glyph_len); + while (c == '\t' && 0 < glyph_len); + bool right_padded = glyph_len < cmp->glyph_len; for (i = 0; i < glyph_len; i++) { - if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t') + c = COMPOSITION_GLYPH (cmp, i); + if (c != '\t') break; cmp->offsets[i * 2] = cmp->offsets[i * 2 + 1] = 0; }