From 8cc53f96e5dc3d647411e01298e4125ed4b00928 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sat, 29 Nov 2008 13:47:31 +0000 Subject: [PATCH] (CHAR_CHARSET_P): Check if the encoder is loaded or not before accessing it. --- src/ChangeLog | 3 +++ src/charset.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index e0575f03d76..1cb44419d1f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2008-11-29 Kenichi Handa + * charset.h (CHAR_CHARSET_P): Check if the encoder is loaded or + not before accessing it. + * charset.c (Fdefine_charset_internal): After calculating min_char, max_char, and fastmap, copy the charset structure again. (encode_char): Fix the previous change. diff --git a/src/charset.h b/src/charset.h index 1dac7add242..fa3f363a9e8 100644 --- a/src/charset.h +++ b/src/charset.h @@ -503,7 +503,8 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; && ((charset)->method == CHARSET_METHOD_OFFSET \ ? (c) >= (charset)->min_char && (c) <= (charset)->max_char \ : ((charset)->method == CHARSET_METHOD_MAP \ - && (charset)->compact_codes_p) \ + && (charset)->compact_codes_p \ + && CHAR_TABLE_P (CHARSET_ENCODER (charset))) \ ? ! NILP (CHAR_TABLE_REF (CHARSET_ENCODER (charset), (c))) \ : encode_char ((charset), (c)) != (charset)->invalid_code))))