]> code.delx.au - gnu-emacs/blobdiff - src/search.c
*** empty log message ***
[gnu-emacs] / src / search.c
index 48528bea12123f0642872ab64f4f745195dfaa40..0bf881565a91f82b28894dc5c689ddf76a5a5f4f 100644 (file)
@@ -180,7 +180,7 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte)
 void
 shrink_regexp_cache ()
 {
-  struct regexp_cache *cp, **cpp;
+  struct regexp_cache *cp;
 
   for (cp = searchbuf_head; cp != 0; cp = cp->next)
     {
@@ -949,7 +949,6 @@ trivial_regexp_p (regexp)
 {
   int len = STRING_BYTES (XSTRING (regexp));
   unsigned char *s = XSTRING (regexp)->data;
-  unsigned char c;
   while (--len >= 0)
     {
       switch (*s++)
@@ -1031,7 +1030,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
   /* Null string is found at starting position.  */
   if (len == 0 || n == 0)
     {
-      set_search_regs (pos, 0);
+      set_search_regs (pos_byte, 0);
       return pos;
     }
 
@@ -1527,7 +1526,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
 {
   int direction = ((n > 0) ? 1 : -1);
   register int dirlen;
-  int infinity, limit, k, stride_for_teases = 0;
+  int infinity, limit, stride_for_teases = 0;
   register int *BM_tab;
   int *BM_tab_base;
   register unsigned char *cursor, *p_limit;  
@@ -2030,6 +2029,10 @@ The match found must not extend before that position.\n\
 Optional third argument, if t, means if fail just return nil (no error).\n\
  If not nil and not t, position at limit of search and return nil.\n\
 Optional fourth argument is repeat count--search for successive occurrences.\n\
+\n\
+Search case-sensitivity is determined by the value of the variable\n\
+`case-fold-search', which see.\n\
+\n\
 See also the functions `match-beginning', `match-end' and `replace-match'.")
   (string, bound, noerror, count)
      Lisp_Object string, bound, noerror, count;
@@ -2046,6 +2049,10 @@ The match found must not extend after that position.  nil is equivalent\n\
 Optional third argument, if t, means if fail just return nil (no error).\n\
   If not nil and not t, move to limit of search and return nil.\n\
 Optional fourth argument is repeat count--search for successive occurrences.\n\
+\n\
+Search case-sensitivity is determined by the value of the variable\n\
+`case-fold-search', which see.\n\
+\n\
 See also the functions `match-beginning', `match-end' and `replace-match'.")
   (string, bound, noerror, count)
      Lisp_Object string, bound, noerror, count;
@@ -2738,6 +2745,9 @@ LIST should have been created by calling `match-data' previously.")
                                       length * sizeof (regoff_t));
          }
 
+       for (i = search_regs.num_regs; i < length; i++)
+         search_regs.start[i] = -1;
+
        search_regs.num_regs = length;
       }
   }
@@ -2752,6 +2762,8 @@ LIST should have been created by calling `match-data' previously.")
        }
       else
        {
+         int from;
+
          if (MARKERP (marker))
            {
              if (XMARKER (marker)->buffer == 0)
@@ -2761,7 +2773,7 @@ LIST should have been created by calling `match-data' previously.")
            }
 
          CHECK_NUMBER_COERCE_MARKER (marker, 0);
-         search_regs.start[i] = XINT (marker);
+         from = XINT (marker);
          list = Fcdr (list);
 
          marker = Fcar (list);
@@ -2769,6 +2781,7 @@ LIST should have been created by calling `match-data' previously.")
            XSETFASTINT (marker, 0);
 
          CHECK_NUMBER_COERCE_MARKER (marker, 0);
+         search_regs.start[i] = from;
          search_regs.end[i] = XINT (marker);
        }
       list = Fcdr (list);