changeset 61647:a39c60b30e5a

(resolve_face_name): Use Fsafe_get to avoid redisplay loops in case of bad face property lists. Limit number of face alias lookups to 10 (in case of face alias loops).
author Kim F. Storm <storm@cua.dk>
date Tue, 19 Apr 2005 08:34:50 +0000
parents 9af68ed35480
children d1980873b722
files src/xfaces.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Tue Apr 19 08:34:33 2005 +0000
+++ b/src/xfaces.c	Tue Apr 19 08:34:50 2005 +0000
@@ -3211,17 +3211,19 @@
      Lisp_Object face_name;
 {
   Lisp_Object aliased;
+  int alias_loop_max = 10;
 
   if (STRINGP (face_name))
     face_name = intern (SDATA (face_name));
 
   while (SYMBOLP (face_name))
     {
-      aliased = Fget (face_name, Qface_alias);
+      aliased = Fsafe_get (face_name, Qface_alias);
       if (NILP (aliased))
 	break;
-      else
-	face_name = aliased;
+      if (--alias_loop_max == 0)
+	break;
+      face_name = aliased;
     }
 
   return face_name;