diff options
| author | Chong Yidong | 2008-04-05 21:42:59 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-04-05 21:42:59 +0000 |
| commit | 37128b5497b54367b25ed149ead91821adc65876 (patch) | |
| tree | 8061f13d6213fa9b1e615b5e712b8f761ea03872 /src | |
| parent | 6ffb36c38082d6b31f85780549ec591f36593fb7 (diff) | |
| download | emacs-37128b5497b54367b25ed149ead91821adc65876.tar.gz emacs-37128b5497b54367b25ed149ead91821adc65876.zip | |
(compile_pattern_1): Treat non-nil and non-string of
search-spaces-regexp as nil.
Diffstat (limited to 'src')
| -rw-r--r-- | src/search.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/search.c b/src/search.c index 773f0701ed2..456d3d46a73 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -171,7 +171,11 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) | |||
| 171 | cp->buf.translate = (! NILP (translate) ? translate : make_number (0)); | 171 | cp->buf.translate = (! NILP (translate) ? translate : make_number (0)); |
| 172 | cp->posix = posix; | 172 | cp->posix = posix; |
| 173 | cp->buf.multibyte = multibyte; | 173 | cp->buf.multibyte = multibyte; |
| 174 | cp->whitespace_regexp = Vsearch_spaces_regexp; | 174 | if (STRINGP (Vsearch_spaces_regexp)) |
| 175 | cp->whitespace_regexp = Vsearch_spaces_regexp; | ||
| 176 | else | ||
| 177 | cp->whitespace_regexp = Qnil; | ||
| 178 | |||
| 175 | /* rms: I think BLOCK_INPUT is not needed here any more, | 179 | /* rms: I think BLOCK_INPUT is not needed here any more, |
| 176 | because regex.c defines malloc to call xmalloc. | 180 | because regex.c defines malloc to call xmalloc. |
| 177 | Using BLOCK_INPUT here means the debugger won't run if an error occurs. | 181 | Using BLOCK_INPUT here means the debugger won't run if an error occurs. |
| @@ -180,8 +184,10 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) | |||
| 180 | old = re_set_syntax (RE_SYNTAX_EMACS | 184 | old = re_set_syntax (RE_SYNTAX_EMACS |
| 181 | | (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); | 185 | | (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); |
| 182 | 186 | ||
| 183 | re_set_whitespace_regexp (NILP (Vsearch_spaces_regexp) ? NULL | 187 | if (STRINGP (Vsearch_spaces_regexp)) |
| 184 | : SDATA (Vsearch_spaces_regexp)); | 188 | re_set_whitespace_regexp (SDATA (Vsearch_spaces_regexp)); |
| 189 | else | ||
| 190 | re_set_whitespace_regexp (NULL); | ||
| 185 | 191 | ||
| 186 | val = (char *) re_compile_pattern ((char *)raw_pattern, | 192 | val = (char *) re_compile_pattern ((char *)raw_pattern, |
| 187 | raw_pattern_size, &cp->buf); | 193 | raw_pattern_size, &cp->buf); |