changeset 95493:c118c1277047

(char_charset): Return NULL if the arg charset_list is specified and C doesn't belong to any of them.
author Kenichi Handa <handa@m17n.org>
date Tue, 03 Jun 2008 04:22:55 +0000
parents 09c5abcca14d
children 99d798015949
files src/charset.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/charset.c	Tue Jun 03 03:15:48 2008 +0000
+++ b/src/charset.c	Tue Jun 03 04:22:55 2008 +0000
@@ -1813,8 +1813,12 @@
      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 @@
 	 && 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));
 }