# HG changeset patch # User Chong Yidong # Date 1218835968 0 # Node ID dc43c2f1d2fceb5e402a2e20accd31753674c6ac # Parent 46d2c5d06bf4a0e0121e04874191fe02efed9953 (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. diff -r 46d2c5d06bf4 -r dc43c2f1d2fc src/xfaces.c --- a/src/xfaces.c Fri Aug 15 21:32:01 2008 +0000 +++ b/src/xfaces.c Fri Aug 15 21:32:48 2008 +0000 @@ -4974,7 +4974,9 @@ if (!default_face) abort (); - get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0); + if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0)) + return -1; + bcopy (default_face->lface, attrs, sizeof attrs); merge_face_vectors (f, symbol_attrs, attrs, 0); return lookup_face (f, attrs); @@ -6533,10 +6535,10 @@ if (face_id < 0 || face_id >= lface_id_to_name_size) return base_face_id; face_name = lface_id_to_name[face_id]; - face_id = lookup_derived_face (f, face_name, base_face_id, 1); - if (face_id >= 0) - return face_id; - return base_face_id; + /* When called during make-frame, lookup_derived_face may fail + if the faces are uninitialized. Don't signal an error. */ + face_id = lookup_derived_face (f, face_name, base_face_id, 0); + return (face_id >= 0 ? face_id : base_face_id); } /* Begin with attributes from the base face. */