Mercurial > emacs
comparison src/w32fns.c @ 57872:71ea49de0560
Use fast_string_match_ignore_case for comparing font names.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Tue, 02 Nov 2004 08:55:10 +0000 |
parents | c955f6add62a |
children | f23a47fb1568 e24e2e78deda |
comparison
equal
deleted
inserted
replaced
57871:da430e282e25 | 57872:71ea49de0560 |
---|---|
5605 static BOOL | 5605 static BOOL |
5606 w32_font_match (fontname, pattern) | 5606 w32_font_match (fontname, pattern) |
5607 char * fontname; | 5607 char * fontname; |
5608 char * pattern; | 5608 char * pattern; |
5609 { | 5609 { |
5610 char *ptr; | |
5610 char *font_name_copy; | 5611 char *font_name_copy; |
5611 char *ptr; | |
5612 Lisp_Object encoded_font_name; | |
5613 char *regex = alloca (strlen (pattern) * 2 + 3); | 5612 char *regex = alloca (strlen (pattern) * 2 + 3); |
5614 | 5613 |
5615 /* Convert fontname to unibyte for match. */ | 5614 font_name_copy = alloca (strlen (fontname) + 1); |
5616 encoded_font_name = string_make_unibyte (build_string (fontname)); | 5615 strcpy (font_name_copy, fontname); |
5617 font_name_copy = SDATA (encoded_font_name); | |
5618 | 5616 |
5619 ptr = regex; | 5617 ptr = regex; |
5620 *ptr++ = '^'; | 5618 *ptr++ = '^'; |
5621 | 5619 |
5622 /* Turn pattern into a regexp and do a regexp match. */ | 5620 /* Turn pattern into a regexp and do a regexp match. */ |
5650 if the heights differ. */ | 5648 if the heights differ. */ |
5651 if (font_height && pattern_height && (font_height != pattern_height)) | 5649 if (font_height && pattern_height && (font_height != pattern_height)) |
5652 return FALSE; | 5650 return FALSE; |
5653 } | 5651 } |
5654 | 5652 |
5655 return (fast_c_string_match_ignore_case (build_string (regex), | 5653 return (fast_string_match_ignore_case (build_string (regex), |
5656 font_name_copy) >= 0); | 5654 build_string(font_name_copy)) >= 0); |
5657 } | 5655 } |
5658 | 5656 |
5659 /* Callback functions, and a structure holding info they need, for | 5657 /* Callback functions, and a structure holding info they need, for |
5660 listing system fonts on W32. We need one set of functions to do the | 5658 listing system fonts on W32. We need one set of functions to do the |
5661 job properly, but these don't work on NT 3.51 and earlier, so we | 5659 job properly, but these don't work on NT 3.51 and earlier, so we |