emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100616: * fontset.c (fontset_get_


From: Andreas Schwab
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100616: * fontset.c (fontset_get_font_group): Add proper type checks.
Date: Tue, 26 Jul 2011 13:00:23 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 100616
committer: Andreas Schwab <address@hidden>
branch nick: emacs
timestamp: Tue 2011-07-26 13:00:23 +0200
message:
  * fontset.c (fontset_get_font_group): Add proper type checks.
  (Bug#9172)
modified:
  src/ChangeLog
  src/fontset.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-07-23 04:04:58 +0000
+++ b/src/ChangeLog     2011-07-26 11:00:23 +0000
@@ -1,3 +1,8 @@
+2011-07-26  Andreas Schwab  <address@hidden>
+
+       * fontset.c (fontset_get_font_group): Add proper type checks.
+       (Bug#9172)
+
 2011-07-23  YAMAMOTO Mitsuharu  <address@hidden>
 
        * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS

=== modified file 'src/fontset.c'
--- a/src/fontset.c     2011-01-02 23:50:46 +0000
+++ b/src/fontset.c     2011-07-26 11:00:23 +0000
@@ -463,7 +463,7 @@
 /* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for
    character C in FONTSET.  If C is -1, return a fallback font-group.
    If C is not -1, the value may be Qt (FONTSET doesn't have a font
-   for C even in the fallback group, or 0 (a font for C may be found
+   for C even in the fallback group), or 0 (a font for C may be found
    only in the fallback group).  */
 
 static Lisp_Object
@@ -481,7 +481,9 @@
   if (! NILP (font_group))
     return font_group;
   base_fontset = FONTSET_BASE (fontset);
-  if (c >= 0)
+  if (NILP (base_fontset))
+    font_group = Qnil;
+  else if (c >= 0)
     font_group = char_table_ref_and_range (base_fontset, c, &from, &to);
   else
     font_group = FONTSET_FALLBACK (base_fontset);
@@ -492,6 +494,8 @@
        char_table_set_range (fontset, from, to, font_group);
       return font_group;
     }
+  if (!VECTORP (font_group))
+    return font_group;
   font_group = Fcopy_sequence (font_group);
   for (i = 0; i < ASIZE (font_group); i++)
     if (! NILP (AREF (font_group, i)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]