comparison src/search.c @ 842:5ce0a9ac1ea7

entered into RCS
author Richard M. Stallman <rms@gnu.org>
date Wed, 22 Jul 1992 03:10:28 +0000
parents 707866b2a190
children 527af9fa8676
comparison
equal deleted inserted replaced
841:2cdce064065f 842:5ce0a9ac1ea7
224 last_thing_searched = Qt; 224 last_thing_searched = Qt;
225 if (val == -2) 225 if (val == -2)
226 matcher_overflow (); 226 matcher_overflow ();
227 if (val < 0) return Qnil; 227 if (val < 0) return Qnil;
228 return make_number (val); 228 return make_number (val);
229 }
230
231 /* Match REGEXP against STRING, searching all of STRING,
232 and return the index of the match, or negative on failure.
233 This does not clobber the match data. */
234
235 int
236 fast_string_match (regexp, string)
237 Lisp_Object regexp, string;
238 {
239 int val;
240
241 compile_pattern (regexp, &searchbuf, 0, 0);
242 immediate_quit = 1;
243 val = re_search (&searchbuf, (char *) XSTRING (string)->data,
244 XSTRING (string)->size, 0, XSTRING (string)->size,
245 0);
246 immediate_quit = 0;
247 return val;
229 } 248 }
230 249
231 /* Search for COUNT instances of the character TARGET, starting at START. 250 /* Search for COUNT instances of the character TARGET, starting at START.
232 If COUNT is negative, search backwards. 251 If COUNT is negative, search backwards.
233 252