From fe4dcb868e1371946b675415fdf19249a606281f Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 2 Nov 2004 08:55:10 +0000 Subject: Use fast_string_match_ignore_case for comparing font names. --- src/w32fns.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/w32fns.c b/src/w32fns.c index 41bd6a9b9f..08780e05b1 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -5607,14 +5607,12 @@ w32_font_match (fontname, pattern) char * fontname; char * pattern; { - char *font_name_copy; char *ptr; - Lisp_Object encoded_font_name; + char *font_name_copy; 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); + font_name_copy = alloca (strlen (fontname) + 1); + strcpy (font_name_copy, fontname); ptr = regex; *ptr++ = '^'; @@ -5652,8 +5650,8 @@ w32_font_match (fontname, pattern) return FALSE; } - return (fast_c_string_match_ignore_case (build_string (regex), - font_name_copy) >= 0); + return (fast_string_match_ignore_case (build_string (regex), + build_string(font_name_copy)) >= 0); } /* Callback functions, and a structure holding info they need, for -- cgit v1.2.3