]> git.eshelyaron.com Git - emacs.git/commitdiff
(char_charset): Return NULL if the arg charset_list is
authorKenichi Handa <handa@m17n.org>
Tue, 3 Jun 2008 04:24:04 +0000 (04:24 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 3 Jun 2008 04:24:04 +0000 (04:24 +0000)
specified and C doesn't belong to any of them.

src/ChangeLog
src/charset.c

index 66f00bcea7aa7be9cebebae84161ca60679be6f1..1ef32828b45b38c91037be8e6d18b73e62e95791 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-03  Kenichi Handa  <handa@m17n.org>
+
+       * charset.c (char_charset): Return NULL if the arg charset_list is
+       specified and C doesn't belong to any of them.
+
 2008-06-02  Chip Coldwell <coldwell@redhat.com>
 
        * font.c (font_pixel_size): Don't take cdr of an integer.
index 052c511f6a39f400af3e5cc2778e92afb2cf5b30..a08089d6d2c9232c40f97d6431dc9f71a72c23b1 100644 (file)
@@ -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));
 }