changeset 100168:acef56f002fc

(face_for_char): Handle invalid charset property correctly. (font_for_char): Likewise.
author Kenichi Handa <handa@m17n.org>
date Wed, 03 Dec 2008 05:30:14 +0000
parents b80052504b85
children 4d13bea1e4bb
files src/fontset.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/fontset.c	Wed Dec 03 05:16:38 2008 +0000
+++ b/src/fontset.c	Wed Dec 03 05:30:14 2008 +0000
@@ -894,9 +894,7 @@
   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 @@
 	    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 @@
   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 @@
 	    charset = XCDR (val);
 	  id = XINT (CHARSET_SYMBOL_ID (charset));
 	}
+      else
+	id = -1;
     }
 
   font_deferred_log ("font for", Fcons (make_number (c), charset), Qnil);