From: Jason Rumney Date: Sat, 9 Feb 2002 01:08:33 +0000 (+0000) Subject: (enum_font_cb2): Don't let charsets unknown to Windows X-Git-Tag: ttn-vms-21-2-B4~16757 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=644cefdf628a3acbcb60426e536877ea678d0bc6;p=emacs.git (enum_font_cb2): Don't let charsets unknown to Windows match each other. --- diff --git a/src/w32fns.c b/src/w32fns.c index 38de4b47ef4..a269645c241 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7038,11 +7038,13 @@ enum_font_cb2 (lplf, lptm, FontType, lpef) { charset = xlfd_charset_of_font (XSTRING(*(lpef->pattern))->data); - /* Ensure that charset is valid for this font. - Continue if invalid in case charset contains a wildcard. */ - if (charset - && (x_to_w32_charset (charset) != lplf->elfLogFont.lfCharSet)) - charset = NULL; + /* We already checked charsets above, but DEFAULT_CHARSET + slipped through. So only allow exact matches for DEFAULT_CHARSET. */ + if (charset + && strncmp (charset, "*-*", 3) != 0 + && lpef->logfont.lfCharSet == DEFAULT_CHARSET + && strcmp (charset, w32_to_x_charset (DEFAULT_CHARSET)) != 0) + return 1; } if (charset)