diff options
| author | Jason Rumney | 2004-10-16 23:02:25 +0000 |
|---|---|---|
| committer | Jason Rumney | 2004-10-16 23:02:25 +0000 |
| commit | 0424a1b04306efa6096a59c38a337a40c7dfd856 (patch) | |
| tree | 719f3d86daf95023759e301a1f3278e55fd70a2d /src | |
| parent | be13cbb78b1986aa44989cf715f05dc07d359348 (diff) | |
| download | emacs-0424a1b04306efa6096a59c38a337a40c7dfd856.tar.gz emacs-0424a1b04306efa6096a59c38a337a40c7dfd856.zip | |
(w32_font_match): Encode font name being matched.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 5cfc4adb0af..1e52155ab3b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -5370,7 +5370,7 @@ x_to_w32_font (lpxstr, lplogfont) | |||
| 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; |
| @@ -5607,12 +5607,14 @@ w32_font_match (fontname, pattern) | |||
| 5607 | char * fontname; | 5607 | char * fontname; |
| 5608 | char * pattern; | 5608 | char * pattern; |
| 5609 | { | 5609 | { |
| 5610 | char *regex = alloca (strlen (pattern) * 2 + 3); | 5610 | char *font_name_copy; |
| 5611 | char *font_name_copy = alloca (strlen (fontname) + 1); | ||
| 5612 | char *ptr; | 5611 | char *ptr; |
| 5612 | Lisp_Object encoded_font_name; | ||
| 5613 | char *regex = alloca (strlen (pattern) * 2 + 3); | ||
| 5613 | 5614 | ||
| 5614 | /* Copy fontname so we can modify it during comparison. */ | 5615 | /* Convert fontname to unibyte for match. */ |
| 5615 | strcpy (font_name_copy, fontname); | 5616 | encoded_font_name = string_make_unibyte (build_string (fontname)); |
| 5617 | font_name_copy = SDATA (encoded_font_name); | ||
| 5616 | 5618 | ||
| 5617 | ptr = regex; | 5619 | ptr = regex; |
| 5618 | *ptr++ = '^'; | 5620 | *ptr++ = '^'; |