diff options
author | Kenichi Handa <handa@m17n.org> | 2008-06-03 04:24:04 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2008-06-03 04:24:04 +0000 |
commit | 8a1816bb4a523e10ad30438e38704fc584bb4854 (patch) | |
tree | b726eb6036835bde3fae5cb185ef7f3e53de83b0 /src/charset.c | |
parent | 6459e35e905394a3b70de95f7e96ecebe88557d2 (diff) | |
download | emacs-8a1816bb4a523e10ad30438e38704fc584bb4854.tar.gz |
(char_charset): Return NULL if the arg charset_list is
specified and C doesn't belong to any of them.
Diffstat (limited to 'src/charset.c')
-rw-r--r-- | src/charset.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/charset.c b/src/charset.c index 052c511f6a3..a08089d6d2c 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1813,8 +1813,12 @@ char_charset (c, charset_list, code_return) Lisp_Object charset_list; unsigned *code_return; { + int maybe_null = 0; + if (NILP (charset_list)) charset_list = Vcharset_ordered_list; + else + maybe_null = 1; while (CONSP (charset_list)) { @@ -1832,7 +1836,8 @@ char_charset (c, charset_list, code_return) && EQ (charset_list, Vcharset_non_preferred_head)) return CHARSET_FROM_ID (charset_unicode); } - return (c <= MAX_5_BYTE_CHAR ? CHARSET_FROM_ID (charset_emacs) + return (maybe_null ? NULL + : c <= MAX_5_BYTE_CHAR ? CHARSET_FROM_ID (charset_emacs) : CHARSET_FROM_ID (charset_eight_bit)); } |