Mercurial > emacs
comparison src/fontset.c @ 35663:e5dea4a61cab
* fontset.c (fontset_pattern_regexp): Allocate three more bytes to
regex for '^', '$', and '\0'.
author | Andrew Choi <akochoi@shaw.ca> |
---|---|
date | Sun, 28 Jan 2001 15:41:57 +0000 |
parents | 3551e8549d4e |
children | 751cb07c5f11 |
comparison
equal
deleted
inserted
replaced
35662:11b616e892be | 35663:e5dea4a61cab |
---|---|
717 | 717 |
718 if (!CONSP (Vcached_fontset_data) | 718 if (!CONSP (Vcached_fontset_data) |
719 || strcmp (XSTRING (pattern)->data, CACHED_FONTSET_NAME)) | 719 || strcmp (XSTRING (pattern)->data, CACHED_FONTSET_NAME)) |
720 { | 720 { |
721 /* We must at first update the cached data. */ | 721 /* We must at first update the cached data. */ |
722 char *regex = (char *) alloca (XSTRING (pattern)->size * 2); | 722 char *regex = (char *) alloca (XSTRING (pattern)->size * 2 + 3); |
723 char *p0, *p1 = regex; | 723 char *p0, *p1 = regex; |
724 | 724 |
725 /* Convert "*" to ".*", "?" to ".". */ | 725 /* Convert "*" to ".*", "?" to ".". */ |
726 *p1++ = '^'; | 726 *p1++ = '^'; |
727 for (p0 = (char *) XSTRING (pattern)->data; *p0; p0++) | 727 for (p0 = (char *) XSTRING (pattern)->data; *p0; p0++) |