From: Chong Yidong Date: Sat, 5 Apr 2008 21:42:59 +0000 (+0000) Subject: (compile_pattern_1): Treat non-nil and non-string of X-Git-Tag: emacs-pretest-22.2.90~237 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37128b5497b54367b25ed149ead91821adc65876;p=emacs.git (compile_pattern_1): Treat non-nil and non-string of search-spaces-regexp as nil. --- 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) 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 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) 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);