X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fsearch.c;h=7ca50a6a0ff04726e241ae0cf8e6df5751a6c82f;hb=1532bc4f9d544bee853b875b78703699bee95fdc;hp=dcfefeefe55c07d9cade48955f9bdf7ac35c5574;hpb=a5812bf2ff9a9cf40f4ff78dcb83f5b4c295bd18;p=chise%2Fxemacs-chise.git.1 diff --git a/src/search.c b/src/search.c index dcfefee..7ca50a6 100644 --- a/src/search.c +++ b/src/search.c @@ -110,7 +110,6 @@ Lisp_Object Vskip_chars_range_table; static void set_search_regs (struct buffer *buf, Bufpos beg, Charcount len); static void clear_unused_search_regs (struct re_registers *regp, int no_sub); -/* #### according to comment in 21.5, unnecessary */ static void save_search_regs (void); static Bufpos simple_search (struct buffer *buf, Bufbyte *base_pat, Bytecount len, Bytind pos, Bytind lim, @@ -1090,7 +1089,7 @@ search_command (Lisp_Object string, Lisp_Object limit, Lisp_Object noerror, if (!EQ (noerror, Qt)) { if (lim < BUF_BEGV (buf) || lim > BUF_ZV (buf)) - abort (); + ABORT (); BUF_SET_PT (buf, lim); return Qnil; #if 0 /* This would be clean, but maybe programs depend on @@ -1103,7 +1102,7 @@ search_command (Lisp_Object string, Lisp_Object limit, Lisp_Object noerror, } if (np < BUF_BEGV (buf) || np > BUF_ZV (buf)) - abort (); + ABORT (); BUF_SET_PT (buf, np); @@ -1120,6 +1119,7 @@ trivial_regexp_p (Lisp_Object regexp) { switch (*s++) { + /* ']' doesn't appear here because it's only special after ] */ case '.': case '*': case '+': case '?': case '[': case '^': case '$': return 0; case '\\': @@ -1129,7 +1129,7 @@ trivial_regexp_p (Lisp_Object regexp) { case '|': case '(': case ')': case '`': case '\'': case 'b': case 'B': case '<': case '>': case 'w': case 'W': case 's': - case 'S': case '=': + case 'S': case '=': case '{': case '}': #ifdef MULE /* 97/2/25 jhod Added for category matches */ case 'c': case 'C': @@ -2777,9 +2777,9 @@ match_limit (Lisp_Object num, int beginningp) CHECK_INT (num); n = XINT (num); - if (n < 0 || n >= search_regs.num_regs) + if (n < 0 || search_regs.num_regs <= 0) args_out_of_range (num, make_int (search_regs.num_regs)); - if (search_regs.num_regs == 0 || + if (n >= search_regs.num_regs || search_regs.start[n] < 0) return Qnil; return make_int (beginningp ? search_regs.start[n] : search_regs.end[n]); @@ -2858,7 +2858,7 @@ to hold all the values, and if INTEGERS is non-nil, no consing is done. } else /* last_thing_searched must always be Qt, a buffer, or Qnil. */ - abort (); + ABORT (); len = i; } @@ -2900,11 +2900,8 @@ LIST should have been created by calling `match-data' previously. int num_regs; int length; -#if 0 - /* #### according to 21.5 comment, unnecessary */ if (running_asynch_code) save_search_regs (); -#endif CONCHECK_LIST (list); @@ -2967,7 +2964,6 @@ LIST should have been created by calling `match-data' previously. return Qnil; } -/* #### according to 21.5 comment, unnecessary */ /* If non-zero the match data have been saved in saved_search_regs during the execution of a sentinel or filter. */ static int search_regs_saved; @@ -2991,8 +2987,6 @@ save_search_regs (void) } } -/* #### according to 21.5 comment, unnecessary - prototype in lisp.h, all calls in process.c */ /* Called upon exit from filters and sentinels. */ void restore_match_data (void)