Mercurial > hg > xemacs-beta
comparison src/mule-charset.c @ 3676:3ef0aaf3dc34
[xemacs-hg @ 2006-11-12 13:40:04 by aidan]
Prevent a crash if the ASCII charset registries match nothing.
author | aidan |
---|---|
date | Sun, 12 Nov 2006 13:40:09 +0000 |
parents | 1d313cd71cd7 |
children | 3131094eed8c |
comparison
equal
deleted
inserted
replaced
3675:0492077a2e85 | 3676:3ef0aaf3dc34 |
---|---|
881 XCHARSET_CCL_PROGRAM (charset) = ccl_program; | 881 XCHARSET_CCL_PROGRAM (charset) = ccl_program; |
882 face_property_was_changed (Vdefault_face, Qfont, Qglobal); | 882 face_property_was_changed (Vdefault_face, Qfont, Qglobal); |
883 return Qnil; | 883 return Qnil; |
884 } | 884 } |
885 | 885 |
886 void | |
887 set_charset_registries(Lisp_Object charset, Lisp_Object registries) | |
888 { | |
889 XCHARSET_REGISTRIES (charset) = registries; | |
890 invalidate_charset_font_caches (charset); | |
891 face_property_was_changed (Vdefault_face, Qfont, Qglobal); | |
892 } | |
893 | |
886 DEFUN ("set-charset-registries", Fset_charset_registries, 2, 2, 0, /* | 894 DEFUN ("set-charset-registries", Fset_charset_registries, 2, 2, 0, /* |
887 Set the `registries' property of CHARSET to REGISTRIES. | 895 Set the `registries' property of CHARSET to REGISTRIES. |
888 | 896 |
889 REGISTRIES is an ordered vector of strings that describe the X11 | 897 REGISTRIES is an ordered vector of strings that describe the X11 |
890 CHARSET_REGISTRY and the CHARSET_ENCODINGs appropriate for this charset. | 898 CHARSET_REGISTRY and the CHARSET_ENCODINGs appropriate for this charset. |
911 if (NULL == qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '-')) | 919 if (NULL == qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '-')) |
912 { | 920 { |
913 invalid_argument("Not an X11 REGISTRY-ENCODING combination", | 921 invalid_argument("Not an X11 REGISTRY-ENCODING combination", |
914 XVECTOR_DATA(registries)[i]); | 922 XVECTOR_DATA(registries)[i]); |
915 } | 923 } |
924 | |
925 if (qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '*') || | |
926 qxestrchr(XSTRING_DATA(XVECTOR_DATA(registries)[i]), '?')) | |
927 { | |
928 invalid_argument | |
929 ("XLFD wildcards not allowed in charset-registries", | |
930 XVECTOR_DATA(registries)[i]); | |
931 | |
932 } | |
916 } | 933 } |
917 | 934 |
918 XCHARSET_REGISTRIES (charset) = registries; | 935 set_charset_registries(charset, registries); |
919 invalidate_charset_font_caches (charset); | 936 |
920 face_property_was_changed (Vdefault_face, Qfont, Qglobal); | |
921 return Qnil; | 937 return Qnil; |
922 } | 938 } |
923 | 939 |
924 | 940 |
925 /************************************************************************/ | 941 /************************************************************************/ |