Mercurial > emacs
comparison src/w32fns.c @ 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 | a35b92556545 |
children | 77c93cbb1721 f3ec05478165 |
comparison
equal
deleted
inserted
replaced
57534:1a10f9dbc3cc | 57535:201c0ad15e73 |
---|---|
5368 unsigned char *buf; | 5368 unsigned char *buf; |
5369 | 5369 |
5370 setup_coding_system | 5370 setup_coding_system |
5371 (Fcheck_coding_system (Vlocale_coding_system), &coding); | 5371 (Fcheck_coding_system (Vlocale_coding_system), &coding); |
5372 coding.src_multibyte = 1; | 5372 coding.src_multibyte = 1; |
5373 coding.dst_multibyte = 1; | 5373 coding.dst_multibyte = 0; |
5374 /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in | 5374 /* Need to set COMPOSITION_DISABLED, otherwise Emacs crashes in |
5375 encode_coding_iso2022 trying to dereference a null pointer. */ | 5375 encode_coding_iso2022 trying to dereference a null pointer. */ |
5376 coding.composing = COMPOSITION_DISABLED; | 5376 coding.composing = COMPOSITION_DISABLED; |
5377 if (coding.type == coding_type_iso2022) | 5377 if (coding.type == coding_type_iso2022) |
5378 coding.flags |= CODING_FLAG_ISO_SAFE; | 5378 coding.flags |= CODING_FLAG_ISO_SAFE; |
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 *font_name_copy; | |
5611 char *ptr; | |
5612 Lisp_Object encoded_font_name; | |
5610 char *regex = alloca (strlen (pattern) * 2 + 3); | 5613 char *regex = alloca (strlen (pattern) * 2 + 3); |
5611 char *font_name_copy = alloca (strlen (fontname) + 1); | 5614 |
5612 char *ptr; | 5615 /* Convert fontname to unibyte for match. */ |
5613 | 5616 encoded_font_name = string_make_unibyte (build_string (fontname)); |
5614 /* Copy fontname so we can modify it during comparison. */ | 5617 font_name_copy = SDATA (encoded_font_name); |
5615 strcpy (font_name_copy, fontname); | |
5616 | 5618 |
5617 ptr = regex; | 5619 ptr = regex; |
5618 *ptr++ = '^'; | 5620 *ptr++ = '^'; |
5619 | 5621 |
5620 /* Turn pattern into a regexp and do a regexp match. */ | 5622 /* Turn pattern into a regexp and do a regexp match. */ |