From 7f77f9f8b14ab425c8593d6e1f3d6747e0cebbf6 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sat, 9 Feb 2002 01:12:53 +0000 Subject: [PATCH] (enum_font_cb2): Don't let charsets unknown to Windows match each other. --- src/ChangeLog | 5 +++++ src/w32fns.c | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c28386f4376..88732ba5e22 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-02-09 Jason Rumney + + * w32fns.c (enum_font_cb2): Don't let charsets unknown to Windows + match each other. + 2002-02-08 Eli Zaretskii * floatfns.c (Fround): Doc fix. diff --git a/src/w32fns.c b/src/w32fns.c index 3ff0a49220a..318a3afce81 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6838,11 +6838,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) -- 2.39.2