changeset 57535:201c0ad15e73

(w32_font_match): Encode font name being matched.
author Jason Rumney <jasonr@gnu.org>
date Sat, 16 Oct 2004 23:02:25 +0000
parents 1a10f9dbc3cc
children 6d4a00278f5e
files src/w32fns.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32fns.c	Sat Oct 16 23:01:19 2004 +0000
+++ b/src/w32fns.c	Sat Oct 16 23:02:25 2004 +0000
@@ -5370,7 +5370,7 @@
           setup_coding_system
             (Fcheck_coding_system (Vlocale_coding_system), &coding);
 	  coding.src_multibyte = 1;
-	  coding.dst_multibyte = 1;
+	  coding.dst_multibyte = 0;
 	  /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in
 	     encode_coding_iso2022 trying to dereference a null pointer.  */
 	  coding.composing = COMPOSITION_DISABLED;
@@ -5607,12 +5607,14 @@
     char * fontname;
     char * pattern;
 {
-  char *regex = alloca (strlen (pattern) * 2 + 3);
-  char *font_name_copy = alloca (strlen (fontname) + 1);
+  char *font_name_copy;
   char *ptr;
-
-  /* Copy fontname so we can modify it during comparison.  */
-  strcpy (font_name_copy, fontname);
+  Lisp_Object encoded_font_name;
+  char *regex = alloca (strlen (pattern) * 2 + 3);
+
+  /* Convert fontname to unibyte for match.  */
+  encoded_font_name = string_make_unibyte (build_string (fontname));
+  font_name_copy = SDATA (encoded_font_name);
 
   ptr = regex;
   *ptr++ = '^';