From b1bde62298d30e1f44497e19cf970d34a7850d64 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 3 Dec 2008 05:30:38 +0000 Subject: [PATCH] (face_for_char): Handle invalid charset property correctly. (font_for_char): Likewise. --- src/ChangeLog | 6 ++++++ src/fontset.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d32c53c9bb0..cc91c56522d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2008-12-03 Kenichi Handa + + * fontset.c (face_for_char): Handle invalid charset property + correctly. + (font_for_char): Likewise. + 2008-12-03 Chong Yidong * font.c (Fopen_font): Compute pixel size correctly. diff --git a/src/fontset.c b/src/fontset.c index 9053fbdc1f3..efa26ae7679 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -894,9 +894,7 @@ face_for_char (f, face, c, pos, object) else { charset = Fget_char_property (make_number (pos), Qcharset, object); - if (NILP (charset)) - id = -1; - else if (CHARSETP (charset)) + if (CHARSETP (charset)) { Lisp_Object val; @@ -905,6 +903,8 @@ face_for_char (f, face, c, pos, object) charset = XCDR (val); id = XINT (CHARSET_SYMBOL_ID (charset)); } + else + id = -1; } font_deferred_log ("font for", Fcons (make_number (c), charset), Qnil); @@ -966,9 +966,7 @@ font_for_char (face, c, pos, object) else { charset = Fget_char_property (make_number (pos), Qcharset, object); - if (NILP (charset)) - id = -1; - else if (CHARSETP (charset)) + if (CHARSETP (charset)) { Lisp_Object val; @@ -977,6 +975,8 @@ font_for_char (face, c, pos, object) charset = XCDR (val); id = XINT (CHARSET_SYMBOL_ID (charset)); } + else + id = -1; } font_deferred_log ("font for", Fcons (make_number (c), charset), Qnil); -- 2.39.2