changeset 80443:929f21105918

(compile_pattern_1): Treat non-nil and non-string of search-spaces-regexp as nil.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 05 Apr 2008 21:42:59 +0000
parents e125dad5187d
children 40bd8bbf555a 4e76a03232e5
files src/search.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Sat Apr 05 21:42:01 2008 +0000
+++ b/src/search.c	Sat Apr 05 21:42:59 2008 +0000
@@ -171,7 +171,11 @@
   cp->buf.translate = (! NILP (translate) ? translate : make_number (0));
   cp->posix = posix;
   cp->buf.multibyte = multibyte;
-  cp->whitespace_regexp = Vsearch_spaces_regexp;
+  if (STRINGP (Vsearch_spaces_regexp))
+    cp->whitespace_regexp = Vsearch_spaces_regexp;
+  else
+    cp->whitespace_regexp = Qnil;
+
   /* rms: I think BLOCK_INPUT is not needed here any more,
      because regex.c defines malloc to call xmalloc.
      Using BLOCK_INPUT here means the debugger won't run if an error occurs.
@@ -180,8 +184,10 @@
   old = re_set_syntax (RE_SYNTAX_EMACS
 		       | (posix ? 0 : RE_NO_POSIX_BACKTRACKING));
 
-  re_set_whitespace_regexp (NILP (Vsearch_spaces_regexp) ? NULL
-			    : SDATA (Vsearch_spaces_regexp));
+  if (STRINGP (Vsearch_spaces_regexp))
+    re_set_whitespace_regexp (SDATA (Vsearch_spaces_regexp));
+  else
+    re_set_whitespace_regexp (NULL);
 
   val = (char *) re_compile_pattern ((char *)raw_pattern,
 				     raw_pattern_size, &cp->buf);