aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2008-04-05 21:40:16 +0000
committerChong Yidong2008-04-05 21:40:16 +0000
commitd8c852509f6218db43e5f2ca8baace02d4fa1294 (patch)
treeef2be25ecc71daff63e39ee112a243b9d8f8f226 /src
parent9605d5675e567196dab376e6b757212f326a7da9 (diff)
downloademacs-d8c852509f6218db43e5f2ca8baace02d4fa1294.tar.gz
emacs-d8c852509f6218db43e5f2ca8baace02d4fa1294.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.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/search.c b/src/search.c
index 56bf47571e1..96daecb728e 100644
--- a/src/search.c
+++ b/src/search.c
@@ -141,7 +141,11 @@ compile_pattern_1 (cp, pattern, translate, regp, posix)
141 cp->posix = posix; 141 cp->posix = posix;
142 cp->buf.multibyte = STRING_MULTIBYTE (pattern); 142 cp->buf.multibyte = STRING_MULTIBYTE (pattern);
143 cp->buf.charset_unibyte = charset_unibyte; 143 cp->buf.charset_unibyte = charset_unibyte;
144 cp->whitespace_regexp = Vsearch_spaces_regexp; 144 if (STRINGP (Vsearch_spaces_regexp))
145 cp->whitespace_regexp = Vsearch_spaces_regexp;
146 else
147 cp->whitespace_regexp = Qnil;
148
145 /* rms: I think BLOCK_INPUT is not needed here any more, 149 /* rms: I think BLOCK_INPUT is not needed here any more,
146 because regex.c defines malloc to call xmalloc. 150 because regex.c defines malloc to call xmalloc.
147 Using BLOCK_INPUT here means the debugger won't run if an error occurs. 151 Using BLOCK_INPUT here means the debugger won't run if an error occurs.
@@ -149,8 +153,11 @@ compile_pattern_1 (cp, pattern, translate, regp, posix)
149 /* BLOCK_INPUT; */ 153 /* BLOCK_INPUT; */
150 old = re_set_syntax (RE_SYNTAX_EMACS 154 old = re_set_syntax (RE_SYNTAX_EMACS
151 | (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); 155 | (posix ? 0 : RE_NO_POSIX_BACKTRACKING));
152 re_set_whitespace_regexp (NILP (Vsearch_spaces_regexp) ? NULL 156
153 : SDATA (Vsearch_spaces_regexp)); 157 if (STRINGP (Vsearch_spaces_regexp))
158 re_set_whitespace_regexp (SDATA (Vsearch_spaces_regexp));
159 else
160 re_set_whitespace_regexp (NULL);
154 161
155 val = (char *) re_compile_pattern ((char *) SDATA (pattern), 162 val = (char *) re_compile_pattern ((char *) SDATA (pattern),
156 SBYTES (pattern), &cp->buf); 163 SBYTES (pattern), &cp->buf);