From e29e9cc6a0b4c6e218304a3e78aab0c9bd93a529 Mon Sep 17 00:00:00 2001 From: tomo Date: Fri, 15 Nov 2002 08:51:51 +0000 Subject: [PATCH] (charset_code_point): Fix problem about inheritance. --- src/mule-charset.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mule-charset.c b/src/mule-charset.c index 1484683..8d7452f 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -1062,16 +1062,18 @@ charset_code_point (Lisp_Object charset, Emchar ch, int defined_only) Lisp_Object mother = XCHARSET_MOTHER (charset); int min = XCHARSET_MIN_CODE (charset); int max = XCHARSET_MAX_CODE (charset); - int code; + int code = -1; if ( CHARSETP (mother) ) code = charset_code_point (mother, ch, defined_only); else if (defined_only) return -1; - else + else if ( ((max == 0) && CHARSETP (mother) + && (XCHARSET_FINAL (charset) == 0)) + || ((min <= ch) && (ch <= max)) ) code = ch; - if ( ((max == 0) && CHARSETP (mother)) || - ((min <= code) && (code <= max)) ) + if ( ((max == 0) && CHARSETP (mother) && (code >= 0)) + || ((min <= code) && (code <= max)) ) { int d = code - XCHARSET_CODE_OFFSET (charset); -- 1.7.10.4