aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-08-15 21:32:48 +0000
committerChong Yidong2008-08-15 21:32:48 +0000
commitd8453278d93bd7a2f61d6be7de08a8d39a98c984 (patch)
tree12dd79cfba6929ed7cefd13c1046a7d2f2695208
parentef1fba80054c436b118c85bb8f62c10a8294775a (diff)
downloademacs-d8453278d93bd7a2f61d6be7de08a8d39a98c984.tar.gz
emacs-d8453278d93bd7a2f61d6be7de08a8d39a98c984.zip
(lookup_derived_face): Properly handle possible zero
return value of get_lface_attributes. (merge_faces): Don't tell lookup_derived_face to signal an error if face is not found.
-rw-r--r--src/xfaces.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index eeade820fcd..66dcfc157fb 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -4974,7 +4974,9 @@ lookup_derived_face (f, symbol, face_id, signal_p)
4974 if (!default_face) 4974 if (!default_face)
4975 abort (); 4975 abort ();
4976 4976
4977 get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0); 4977 if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0))
4978 return -1;
4979
4978 bcopy (default_face->lface, attrs, sizeof attrs); 4980 bcopy (default_face->lface, attrs, sizeof attrs);
4979 merge_face_vectors (f, symbol_attrs, attrs, 0); 4981 merge_face_vectors (f, symbol_attrs, attrs, 0);
4980 return lookup_face (f, attrs); 4982 return lookup_face (f, attrs);
@@ -6533,10 +6535,10 @@ merge_faces (f, face_name, face_id, base_face_id)
6533 if (face_id < 0 || face_id >= lface_id_to_name_size) 6535 if (face_id < 0 || face_id >= lface_id_to_name_size)
6534 return base_face_id; 6536 return base_face_id;
6535 face_name = lface_id_to_name[face_id]; 6537 face_name = lface_id_to_name[face_id];
6536 face_id = lookup_derived_face (f, face_name, base_face_id, 1); 6538 /* When called during make-frame, lookup_derived_face may fail
6537 if (face_id >= 0) 6539 if the faces are uninitialized. Don't signal an error. */
6538 return face_id; 6540 face_id = lookup_derived_face (f, face_name, base_face_id, 0);
6539 return base_face_id; 6541 return (face_id >= 0 ? face_id : base_face_id);
6540 } 6542 }
6541 6543
6542 /* Begin with attributes from the base face. */ 6544 /* Begin with attributes from the base face. */