aboutsummaryrefslogtreecommitdiffstats
path: root/src/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/search.c b/src/search.c
index 1e2036f6dc2..bf93a7fe442 100644
--- a/src/search.c
+++ b/src/search.c
@@ -114,17 +114,13 @@ matcher_overflow (void)
114 PATTERN is the pattern to compile. 114 PATTERN is the pattern to compile.
115 CP is the place to put the result. 115 CP is the place to put the result.
116 TRANSLATE is a translation table for ignoring case, or nil for none. 116 TRANSLATE is a translation table for ignoring case, or nil for none.
117 REGP is the structure that says where to store the "register"
118 values that will result from matching this pattern.
119 If it is 0, we should compile the pattern not to record any
120 subexpression bounds.
121 POSIX is nonzero if we want full backtracking (POSIX style) 117 POSIX is nonzero if we want full backtracking (POSIX style)
122 for this pattern. 0 means backtrack only enough to get a valid match. 118 for this pattern. 0 means backtrack only enough to get a valid match.
123 119
124 The behavior also depends on Vsearch_spaces_regexp. */ 120 The behavior also depends on Vsearch_spaces_regexp. */
125 121
126static void 122static void
127compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, Lisp_Object translate, struct re_registers *regp, int posix) 123compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, Lisp_Object translate, int posix)
128{ 124{
129 char *val; 125 char *val;
130 reg_syntax_t old; 126 reg_syntax_t old;
@@ -247,7 +243,7 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp, Lisp_Object tra
247 if (cp->next == 0) 243 if (cp->next == 0)
248 { 244 {
249 compile_it: 245 compile_it:
250 compile_pattern_1 (cp, pattern, translate, regp, posix); 246 compile_pattern_1 (cp, pattern, translate, posix);
251 break; 247 break;
252 } 248 }
253 } 249 }
@@ -1558,7 +1554,6 @@ simple_search (EMACS_INT n, unsigned char *pat,
1558 1554
1559 while (this_len > 0) 1555 while (this_len > 0)
1560 { 1556 {
1561 int charlen;
1562 int pat_ch, buf_ch; 1557 int pat_ch, buf_ch;
1563 1558
1564 DEC_BOTH (this_pos, this_pos_byte); 1559 DEC_BOTH (this_pos, this_pos_byte);
@@ -1730,17 +1725,17 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat,
1730 /* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a 1725 /* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a
1731 byte following them are the target of translation. */ 1726 byte following them are the target of translation. */
1732 unsigned char str[MAX_MULTIBYTE_LENGTH]; 1727 unsigned char str[MAX_MULTIBYTE_LENGTH];
1733 int len = CHAR_STRING (char_base, str); 1728 int cblen = CHAR_STRING (char_base, str);
1734 1729
1735 translate_prev_byte1 = str[len - 2]; 1730 translate_prev_byte1 = str[cblen - 2];
1736 if (len > 2) 1731 if (cblen > 2)
1737 { 1732 {
1738 translate_prev_byte2 = str[len - 3]; 1733 translate_prev_byte2 = str[cblen - 3];
1739 if (len > 3) 1734 if (cblen > 3)
1740 { 1735 {
1741 translate_prev_byte3 = str[len - 4]; 1736 translate_prev_byte3 = str[cblen - 4];
1742 if (len > 4) 1737 if (cblen > 4)
1743 translate_prev_byte4 = str[len - 5]; 1738 translate_prev_byte4 = str[cblen - 5];
1744 } 1739 }
1745 } 1740 }
1746 } 1741 }
@@ -2474,7 +2469,7 @@ since only regular expressions have distinguished subexpressions. */)
2474 else 2469 else
2475 FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, pos, pos_byte); 2470 FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, pos, pos_byte);
2476 2471
2477 if (LOWERCASEP (c)) 2472 if (lowercasep (c))
2478 { 2473 {
2479 /* Cannot be all caps if any original char is lower case */ 2474 /* Cannot be all caps if any original char is lower case */
2480 2475
@@ -2484,7 +2479,7 @@ since only regular expressions have distinguished subexpressions. */)
2484 else 2479 else
2485 some_multiletter_word = 1; 2480 some_multiletter_word = 1;
2486 } 2481 }
2487 else if (UPPERCASEP (c)) 2482 else if (uppercasep (c))
2488 { 2483 {
2489 some_uppercase = 1; 2484 some_uppercase = 1;
2490 if (SYNTAX (prevc) != Sword) 2485 if (SYNTAX (prevc) != Sword)