font.c (Ffont_shape_gstring): Terminate GSTRING by nil if the number of glyphs gets...
authorKenichi Handa <handa@etlken>
Mon, 26 Jul 2010 04:28:02 +0000 (13:28 +0900)
committerKenichi Handa <handa@etlken>
Mon, 26 Jul 2010 04:28:02 +0000 (13:28 +0900)
src/ChangeLog
src/font.c

index 414f22d..7e79e65 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-26  Kenichi Handa  <handa@m17n.org>
+
+       * font.c (Ffont_shape_gstring): Terminate GSTRING by nil if the
+       number of glyphs gets smaller than the original length.
+
 2010-07-20  Juanma Barranquero  <lekktu@gmail.com>
 
        * alloc.c (emacs_blocked_free, emacs_blocked_malloc)
index cb3e9c5..ed4da9c 100644 (file)
@@ -4492,6 +4492,8 @@ created glyph-string.  Otherwise, the value is nil.  */)
     }
   if (i == 3 || XINT (n) == 0)
     return Qnil;
+  if (XINT (n) < LGSTRING_GLYPH_LEN (gstring))
+    LGSTRING_SET_GLYPH (gstring, XINT (n), Qnil);
 
   glyph = LGSTRING_GLYPH (gstring, 0);
   from = LGLYPH_FROM (glyph);