diff options
| author | Richard M. Stallman | 1992-07-22 03:10:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-07-22 03:10:28 +0000 |
| commit | e59a84533d670449f4e42feab72b4427527b2e61 (patch) | |
| tree | 7915b3852a825280ef1c7800b342f18303d5771e /src | |
| parent | 5814274441e07c578c67f33a13e018abb9acfc14 (diff) | |
| download | emacs-e59a84533d670449f4e42feab72b4427527b2e61.tar.gz emacs-e59a84533d670449f4e42feab72b4427527b2e61.zip | |
entered into RCS
Diffstat (limited to 'src')
| -rw-r--r-- | src/search.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/search.c b/src/search.c index f0ee12f4119..83ddaeba143 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -227,6 +227,25 @@ matched by parenthesis constructs in the pattern.") | |||
| 227 | if (val < 0) return Qnil; | 227 | if (val < 0) return Qnil; |
| 228 | return make_number (val); | 228 | return make_number (val); |
| 229 | } | 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; | ||
| 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. |