# HG changeset patch # User Kenichi Handa # Date 858727894 0 # Node ID 00252a78ce4fb3c1bacbfc0e176578201c19f1e6 # Parent 47bfc66eb7f16e638bb3cc8be3c84368ab72bc3e (GLYPH_FOLLOW_ALIASES): Assure that the resulting G contains valid character code. diff -r 47bfc66eb7f1 -r 00252a78ce4f src/disptab.h --- a/src/disptab.h Tue Mar 18 23:31:34 1997 +0000 +++ b/src/disptab.h Tue Mar 18 23:31:34 1997 +0000 @@ -77,10 +77,14 @@ /* Follow all aliases for G in the glyph table given by (BASE, LENGTH), and set G to the final glyph. */ -#define GLYPH_FOLLOW_ALIASES(base, length, g) \ - while (GLYPH_ALIAS_P ((base), (length), (g))) \ - (g) = GLYPH_ALIAS ((base), (g)); - +#define GLYPH_FOLLOW_ALIASES(base, length, g) \ + do { \ + while (GLYPH_ALIAS_P ((base), (length), (g))) \ + (g) = GLYPH_ALIAS ((base), (g)); \ + if (!GLYPH_CHAR_VALID_P (FAST_GLYPH_CHAR (g))) \ + g = FAST_MAKE_GLYPH (' ', FAST_GLYPH_FACE (g)); \ + } while (0) + /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0, return the length and the address of the character-sequence used for outputting GLYPH G. */