changeset 95194:6be267398fe5

(font_prop_validate_style): Adjusted for the format change of font_style_table.
author Kenichi Handa <handa@m17n.org>
date Thu, 22 May 2008 05:20:54 +0000
parents d90ff358ee27
children 119ec8851aac
files src/font.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/font.c	Thu May 22 05:03:00 2008 +0000
+++ b/src/font.c	Thu May 22 05:20:54 2008 +0000
@@ -500,13 +500,16 @@
   if (INTEGERP (val))
     {
       n = XINT (val);
-      if ((n & 0xFF)
+      if (((n >> 4) & 0xF)
 	  >= ASIZE (AREF (font_style_table, prop - FONT_WEIGHT_INDEX)))
 	val = Qerror;
       else
 	{
-	  Lisp_Object elt = AREF (AREF (font_style_table, prop - FONT_WEIGHT_INDEX), n & 0xFF);
-	  if (XINT (XCDR (elt)) != (n >> 8))
+	  Lisp_Object elt = AREF (AREF (font_style_table, prop - FONT_WEIGHT_INDEX), (n >> 4) & 0xF);
+
+	  if ((n & 0xF) + 1 >= ASIZE (elt))
+	    val = Qerror;
+	  else if (XINT (AREF (elt, 0)) != (n >> 8))
 	    val = Qerror;
 	}
     }