regex.c


Log

Author Commit Date CI Message
Richard Stallman 34755e3a 1999-01-19T03:24:03 (re_match_2_internal) [WINDOWSNT & emacs]: Insert QUIT at various places.
Richard Stallman 139214a5 1998-12-30T20:44:39 (re_compile_fastmap): Do something similar to the previous change, for charset_not, wordchar, notwordchar, categoryspec, notcategoryspec.
Karl Heuer 2f425990 1998-12-10T03:09:12 (re_compile_fastmap): For anychar, set all fastmap elements for all possible unibyte chars (except newline).
Karl Heuer c62520bb 1998-11-10T07:03:05 (regex_compile): Handle translation of multibyte exact-match characters.
Richard Stallman 19668ec8 1998-07-25T06:40:50 (regex_compile): Declare p with non-const type on AIX.
Richard Stallman 47f34bb6 1998-06-09T20:12:44 (PTR_TO_OFFSET): Alternate definition if not `emacs'.
Richard Stallman f78b8d0d 1998-06-06T21:59:21 (POS_AS_IN_BUFFER): Add 1 only if operating on a buffer. (re_match_2, re_search_2): Adjust startpos or pos by 1 only if acting on a buffer. nil for re_match_object means a buffer. (re_match_2_internal <notwordbeg>): Assume POS1 is positive.
Richard Stallman f6fc39af 1998-05-25T20:14:54 (re_search_2): Don't use ++ inside RE_TRANSLATE. (re_match_2_internal): Likewise.
Richard Stallman 393454fb 1998-05-06T20:46:35 (regex_compile): When checking after exactn for a repetition operator, don't look beyond end of pattern arg.
Andreas Schwab 6f65addf 1998-04-29T09:23:15 (re_search_2): Fix indentation.
Richard Stallman a12e40eb 1998-04-25T03:37:36 (re_search_2): Fix handling of at_dot. Fix the way RANGE is set when handling begbuf.
Andreas Schwab 213afad1 1998-04-15T10:33:18 Use RE_TRANSLATE_P to check whether translation is needed.
Andreas Schwab 7a847ad3 1998-04-15T09:39:40 (realloc) <emacs>: Define to xrealloc.
Karl Heuer 64af85fe 1998-04-12T06:57:47 (re_match_2, re_search_2): Convert position to a charpos, before calling SETUP_SYNTAX_TABLE_FOR_OBJECT.
Karl Heuer 2d79084e 1998-04-07T04:07:58 (re_match_2) <anychar>: In unibyte case, set buf_ch as unsigned.
Richard Stallman 5e47a7f0 1998-04-07T03:21:46 (re_match_2_internal): Declare buf_ch unsigned int.
Richard Stallman f4b339a2 1998-04-04T00:00:06 (regex_compile) [!MATCH_MAY_ALLOCATE]: Fix paren error.
Richard Stallman 42f97e3f 1998-04-03T07:33:13 (compile_range): Unused function deleted. (regex_compile): Special handling for range \177-\377. (regex_compile): Cast args to TRANSLATE to unsigned char. (re_search_2): Fix forward scan handling multibyte. Recognize that nonascii characters are not in the fastmap. Handle fetching multibyte characters for backward scan, (re_match_2_internal): Handle multibyte and translation in exactn and anychar. (bcmp_translate): Handle multibyte chars for translation. (TRANSLATE): Don't cast to unsigned char. (PATFETCH): Use RE_TRANSLATE to translate.
Richard Stallman 02c33167 1998-01-16T17:56:40 (re_match_2_internal): Use SYNTAX_TABLE_BYTE_TO_CHAR. (re_match_2_internal) <wordbeg, wordend>: Call UPDATE_SYNTAX_TABLE properly with a charpos.
Richard Stallman 7bb256f0 1998-01-09T23:24:24 (re_search_2): Fix call to CHAR_HEAD_P. (re_match_2_internal): Use PTR_BYTE_POS and PT_BYTE.
Karl Heuer 6362f299 1997-12-11T07:21:05 (GROW_FAIL_STACK): Fix test for stack size at max.
Karl Heuer fbbc28d1 1997-12-09T23:04:38 (GROW_FAIL_STACK): Fix previous change: update (fail_stack).size properly.
Karl Heuer 9a15e12b 1997-12-09T23:01:27 (TYPICAL_FAILURE_SIZE): Renamed from MAX_FAILURE_ITEMS. Define it simply as a number. (DOUBLE_FAIL_STACK, regex_compile): Set the limit at the size TYPICAL_FAILURE_SIZE specifies, rather than at twice that much. (re_max_failures): Double the initial values. (INIT_FAIL_STACK): Use TYPICAL_FAILURE_SIZE so that INIT_FAILURE_ALLOC counts in the proper units. (INIT_FAILURE_ALLOC): Increase to 20. (FAIL_STACK_GROWTH_FACTOR): New macro. (GROW_FAIL_STACK): Renamed from DOUBLE_FAIL_STACK. FAIL_STACK_GROWTH_FACTOR controls what ratio to increase size by.
Richard Stallman f5edf8ad 1997-08-06T06:31:13 Whitespace change.
Richard Stallman dfa8d626 1997-07-04T20:46:22 (TRANSLATE, re_search_2, re_match_2_internal,bcmp_translate): Use RE_TRANSLATE instead of accessing translate array directly.
Richard Stallman 837c5301 1997-07-02T06:25:00 (re_search_2): Cast result of POS_ADDR_VSTRING.
Richard Stallman 3f8c9c6b 1997-06-15T19:43:01 Fix previous change.
Richard Stallman 2d876c4b 1997-06-15T19:05:59 Fix up whitespace.
Richard Stallman e074b658 1997-06-15T19:00:12 (PTR_TO_OFFSET): New macro. (POS_AS_IN_BUFFER): New macro. (SYNTAX_ENTRY_VIA_PROPERTY): Set to take `syntax-table' text property into account when doing SYNTAX (c). (re_compile_fastmap): disable fastmap if any of wordbound notwordbound wordbeg wordend notsyntaxspec syntaxspec are seen. (re_search_2): SETUP_SYNTAX_TABLE_FOR_OBJECT at the start. (re_match_object): New variable. (re_match_2): SETUP_SYNTAX_TABLE_FOR_OBJECT at the start. (re_match_2_internal): For any of wordbound notwordbound wordbeg wordend notsyntaxspec syntaxspec call UPDATE_SYNTAX_TABLE before doing SYNTAX (c). [emacs]: Include charset.h and category.h [!emacs] (BASE_LEADING_CODE_P, WORD_BOUNDARY_P, CHAR_HEAD_P, SINGLE_BYTE_CHAR_P, SAME_CHARSET_P, MULTIBYTE_FORM_LENGTH, STRING_CHAR_AND_LENGTH, GET_CHAR_AFTER_2, GET_CHAR_BEFORE_2): New dummy macros. (enum re_opcode_t): New member categoryspec and notcategoryspec. (STORE_CHARACTER_AND_INCR, EXTRACT_CHARACTER, CHARSET_LOOKUP_RANGE_TABLE_WITH_COUNT, CHARSET_LOOKUP_RANGE_TABLE, CHARSET_BITMAP_SIZE, CHARSET_RANGE_TABLE_EXISTS_P, CHARSET_RANGE_TABLE CHARSET_PAST_RANGE_TABLE): New macros. (TRANSLATE): Cast return value to unsigned char, not char. (struct range_table_work_area): New structure. (EXTEND_RANGE_TABLE_WORK_AREA, SET_RANGE_TABLE_WORK_AREA, FREE_RANGE_TABLE_WORK_AREA, CLEAR_RANGE_TABLE_WORK_USED, RANGE_TABLE_WORK_USED, RANGE_TABLE_WORK_ELT): New macros. (FREE_STACK_RETURN): Call FREE_RANGE_TABLE_WORK_AREA. (regex_compile): Declare `c' and `c1' as int to store multibyte characters. Declare range_table_work and initialize it. Initialize bufp->multibyte to 0 if not emacs. For case '[' and `default', code re-written to handle multibyte characters. Add code for case 'c' and 'C' to handle category spec. (re_compile_fastmap): New local variables k, simple_char_max, and match_any_multibyte_characters. Use macro CHARSET_BITMAP_SIZE. Handle multibyte characters in cases charset, charset_not, wordchar, notwordchar, anychar, syntaxspec, notsyntaxspec, categoryspec, notcategoryspec. (STOP_ADDR_VSTRING, POS_ADDR_VSTRING): New macros. (re_search_2): Code re-written to handle multibyte characters. (AT_WORD_BOUNDARY): Macro disabled. (re_match_2_internal): New local variable multibyte. `d' is incremented while paying attention to multibyte characters if necessary. For case charset, charsetnot, wordbound, notwordbound, wordbeg, wordend, matchsyntax, and matchnotsyntax, code re-written to handle multibyte characters. Add code for case categoryspec and notcategoryspec. Declare c, c1 as unsigned int, not unsigned char.
Richard Stallman c90c4710 1996-11-07T21:13:22 [emacs] (malloc, free): Define as xmalloc, and xfree.
Richard Stallman c38e8a15 1996-09-19T03:00:06 (regex_compile): Use TRANSLATE before calling SET_LIST_BIT.
Karl Heuer e09c3726 1996-09-01T19:02:26 (re_match_2_internal) [emacs]: Use PT, not point.
Richard Stallman 2f647319 1996-08-31T23:41:26 Clean up whitespace.
Richard Stallman 414709cd 1996-08-31T23:40:19 (re_search_2): Optimize regexp that starts with ^.
Richard Stallman 69897078 1996-08-31T22:29:12 (FREE_VAR): Clean up C syntax.
Richard Stallman 83ad3d8c 1996-08-09T10:44:37 (re_max_failures): Increase to 20000 again.
Roland McGrath 301bba0b 1996-07-09T09:10:39 [_LIBC] (re_comp, re_exec): Use `weak_function' keyword in defn instead of weak_symbol macro after.
Richard Stallman 93f802eb 1996-06-26T18:00:52 (re_max_failures): Reduce to 4000.
Richard Stallman 9fd34984 1996-06-02T21:33:01 (re_max_failures): Reduce to 8000.
Roland McGrath 0b53893b 1996-05-24T18:33:30 Tue May 21 19:18:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * regex.c [_LIBC] (re_comp, re_exec): Define these, but weakly.
Richard Stallman 49fb692d 1996-05-12T22:19:55 Delete the Emacs local variables spec.
Richard Stallman 23c946d6 1996-05-11T18:05:52 (re_match_2_internal): Fix off-by-one error; don't use length of exactn as character, and don't use length of bitmap of charset as bitmap.
Richard Stallman 41bedd57 1996-04-12T22:57:28 (MAX_FAILURE_ITEMS): Use 5 instead of actual number of regs.
Karl Heuer df2594c7 1996-01-29T22:25:51 Update FSF address in comment.
Karl Heuer d8e9ddab 1995-12-13T02:52:23 (AT_WORD_BOUNDARY): Disable macro. (re_match_2_internal): Work around compiler bug.
Roland McGrath b15e81ad 1995-11-16T02:51:19 (gettext_noop): New macro, identity fn. (re_error_msgid): Mark strings with that, to ease message catalog creation.
Richard Stallman c26fc754 1995-11-11T20:51:37 (NUM_FAILURE_ITEMS, POP_FAILURE_POINT, PUSH_FAILURE_POINT): Do not test for backtracking--do the same thing with or without. (_GNU_SOURCE): Undef before defining. (re_max_failures): Initialize to just 20000.
Richard Stallman bacf0a7d 1995-10-29T19:36:39 (POP_FAILURE_POINT): Use .word.integer.
Richard Stallman 3bb6a39f 1995-10-22T17:47:13 Don't declare alloca.
Richard Stallman b28e3978 1995-10-19T00:50:51 (TRANSLATE, PATFETCH): Cast elt of `translate'. Don't define if already defined. (regex_compile): Use RE_TRANSLATE_TYPE for `translate'. (compile_range, re_search_2, re_match_2_internal, bcmp_translate) (regcomp): Use RE_TRANSLATE_TYPE for `translate'.
Richard Stallman 58d50470 1995-10-01T20:17:02 (re_search_2): Use 0, not -1, as the lower bound for the match position when we adjust RANGE.
Richard Stallman 38f1379d 1995-09-01T18:43:30 (re_search_2): If pattern starts with \=, optimize search.
Richard Stallman dcfe0405 1995-08-22T19:44:26 (PUSH_FAILURE_POINT, POP_FAILURE_POINT): Don't push or pop register values if POSIX backtracking is turned off. (NUM_FAILURE_ITEMS): Value is 0 if no POSIX backtracking.
Karl Heuer f4a6f048 1995-07-17T23:24:57 Fix conditional.
Richard Stallman 2db486e1 1995-07-07T13:20:16 Don't use relocatable allocator.
Richard Stallman f5480e4a 1995-06-20T03:11:14 Use `defined' to test HAVE_STRING_H and STDC_HEADERS.
Karl Heuer 0424b458 1995-06-03T17:32:10 Undefined INHIBIT_STRING_HEADER when we have no other way of getting a bcopy and a bzero.
Karl Heuer 19a3ecee 1995-05-29T06:15:30 (at_endline_loc_p): Use 0, not NULL, in ?: for next_next.
Karl Heuer 4ab0903a 1995-05-26T22:35:10 (NULL): Use explicit cast.
Jim Meyering 03f2d7c0 1995-05-21T06:19:05 [REGEX_FREE]: Use ((void)0) instead of just (0).
Roland McGrath 72d7735e 1995-05-20T16:40:11 Add `#ifdef _LIBC' in a few places, so this can be compiled in libc.
Roland McGrath 024d33aa 1995-05-17T20:54:49 Updated from ../gpl2lgpl.sed /home/gd/gnu/lib/regex.c
Karl Heuer 65b12a92 1995-05-17T20:29:52 (re_compile_fastmap): Undo previous change. (RESET_FAIL_STACK): New macro. (re_compile_fastmap): Use RESET_FAIL_STACK, not REGEX_FREE_STACK directly.
Richard Stallman d5dda417 1995-05-15T23:30:28 (re_compile_fastmap): Don't free stack if it's empty. (re_match_failures): Reduce the larger value to 200000, and use whenever if MATCH_MAY_ALLOCATE. (MATCH_MAY_ALLOCATE): Don't consider REL_ALLOC when deciding whether to undef this.
Richard Stallman 372b6ed4 1995-05-06T20:14:52 [! emacs]: #undef REL_ALLOC.
Richard Stallman 079ec867 1995-05-02T16:27:24 (union fail_stack_elt): New union. (fail_stack_elt_t): Use that union. (PUSH_PATTERN_OP, PUSH_FAILURE_POINTER, PUSH_FAILURE_INT) (POP_FAILURE_POINTER, POP_FAILURE_INT): Corresponding changes. (re_compile_fastmap): Corresponding changes. (PUSH_FAILURE_ELT): New macro. (FAIL_STACK_TOP): Macro deleted. (WIDE_INT): Macro deleted. (PUSH_FAILURE_POINT): Use PUSH_FAILURE_ELT. (POP_FAILURE_ELT): New macro. (POP_FAILURE_POINT): Use POP_FAILURE_ELT.
Richard Stallman b634689f 1995-04-29T20:21:41 (PUSH_FAILURE_INT, POP_FAILURE_INT): Use WIDE_INT. (WIDE_INT): Defined (two alternate definitions). (C_ALLOCA): Undef it, if __GNUC__. (REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK) (REGEX_FREE_STACK): New macros. (INIT_FAIL_STACK, DOUBLE_FAIL_STACK, FREE_VARIABLES): Use them. (re_max_failures) [REL_ALLOC]: Alternative larger initial value. (re_compile_fastmap): Use REGEX_FREE_STACK. (re_match_2_internal): Always call FREE_VARIABLES before returning. Always init regstart, old_regstart, etc. whenever MATCH_MAY_ALLOCATE is defined. (FREE_VARIABLES) [REL_ALLOC]: Define non-trivially.
Richard Stallman 8bd7f00f 1995-04-09T19:14:40 (re_match_2_internal): Eliminate cast of ptr to int. (PUSH_FAILURE_ITEM, POP_FAILURE_ITEM): Macros deleted. (PUSH_FAILURE_INT, POP_FAILURE_INT): New macros. (PUSH_FAILURE_POINTER, POP_FAILURE_POINTER): New macros. (re_match_2_internal): Rename label `succeed' to `succeed_label'.
Jim Meyering 993d006a 1995-02-28T13:46:40 (SET_REGS_MATCHED): Enclose if-stmt in `do {...} while(0)' instead of using trailing `else' -- otherwise, gcc -Wall complains of `empty body in an else-statement'.
Karl Heuer 29052bf0 1995-01-18T20:47:36 [!emacs] (SWITCH_ENUM_CAST): New macro, from emacs/lisp.h (re_compile_fastmap, re_match_2_internal): Use that macro instead of testing SWITCH_ENUM_BUG.
Richard Stallman a151c685 1994-12-30T23:28:45 (regex_compile): Use putchar, not printchar.
Richard Stallman 2a3ec5ac 1994-12-24T23:40:43 (SET_REGS_MATCHED): Do nothing if set_regs_matched_done is 1. Set set_regs_matched_done to 1. (re_match_2_internal): New local var set_regs_matched_done. Set it to 0 when appropriate. (POP_FAILURE_POINT): Set set_regs_matched_done to 0. (re_match_2_internal, case duplicate): Call SET_REGS_MATCHED.
Jim Meyering 3a78e396 1994-12-11T23:16:11 [REG_UNSET_VALUE]: Define to the address of a static variable rather than to ((char *) -1). The latter got a warning on IRIX64.
Karl Heuer f691792f 1994-12-01T22:59:35 (gettext): Make sure this is always defined, even #if emacs. (NULL): No need to #undef this anymore; Emacs uses NILP now.
Paul Eggert 47386749 1994-11-29T16:25:39 (re_compile_pattern, re_comp, regerror): Add gettext wrapper. (re_error_msgid): Renamed from `re_error_msg', for consistency with other source files that declare arrays of message ids. Identifiers ending in `msgid' are special to to some prototype message-extracting utilities. Make "Success" be the 0th entry, so it can be extracted too. (re_comp): Replace "Memory exhausted" with re_error_msgid[REG_ESPACE], to aid message consistency.
Richard Stallman ef355703 1994-11-19T13:57:27 (re_compile_fastmap): Really, really treat `succeed' like end.
Richard Stallman 4d70dae6 1994-11-19T10:37:38 (re_compile_fastmap): Really treat `succeed' like end.
Karl Heuer f3bbc7d9 1994-11-18T01:04:41 (re_compile_fastmap): Treat `succeed' like end of pattern.
Richard Stallman 9ce56b15 1994-11-16T20:29:39 (re_opcode_t): New opcode `succeed' (re_match_2_internal): Handle `succeed'. (regex_compile): Handle RE_NO_BACKTRACKING. (re_syntax_options): Delete initializer.
Paul Eggert f683a15f 1994-10-26T22:43:45 (re_comp, re_exec): Define this obsolete 4.2bsd interface only if the new feature test macro _REGEX_RE_COMP is defined. This avoids a clash with Cray YMP include files.
Karl Heuer ffe2d238 1994-10-18T03:48:00 (exactn): Initializer deleted.
Richard Stallman c5e2eb9e 1994-10-01T09:07:05 Comment change.
Richard Stallman c48e3b6b 1994-10-01T09:06:07 (compile_range): When casting to const unsigned char *, put const first.
David J. MacKenzie ee000fca 1994-09-26T21:59:04 remove CONFIG_BROKETS
Richard Stallman 27ddb52d 1994-08-17T23:13:50 (regex_compile): Split an if to avoid compiler bug. (re_match_2_internal): Use separate if to compute bestmatch_p.
Richard Stallman 7e1f424f 1994-07-31T20:59:32 (compile_range): Avoid warning in casts for range_start/end.
Richard Stallman fa9bc2e0 1994-07-15T07:48:35 (re_match_2_internal): Add casts to shut up some compilers. (FREE_STACK_RETURN): Nest the free inside the return.
Richard Stallman 5fa9de2f 1994-07-05T07:25:05 Be less eager to define MATCH_MAY_ALLOCATE.
Richard Stallman 35b1ca49 1994-07-02T00:10:58 (re_compile_fastmap): Either set fastmap['\n'] to 1 or don't change it. (re_match_2_internal): If the last match is real best match, don't restore second best one.
Richard Stallman d67d8aa8 1994-07-01T06:19:16 entered into RCS
Jim Meyering fce39f5c 1994-05-06T15:23:06 *** empty log message ***
Richard Stallman 2cf947da 1994-05-04T21:21:25 *** empty log message ***
Richard Stallman 3f1f92b3 1994-05-04T01:58:05 *** empty log message ***
Karl Heuer 3ec5c68b 1994-04-27T20:02:46 *** empty log message ***
Richard Stallman bd047239 1994-04-23T04:07:29 *** empty log message ***
Karl Heuer 58aaedfe 1994-04-21T19:45:27 *** empty log message ***
Karl Heuer 5b336d45 1994-04-21T19:26:10 *** empty log message ***
Richard Stallman aa858093 1994-04-21T03:24:35 *** empty log message ***
Richard Stallman 85e4db5e 1994-03-26T05:37:00 *** empty log message ***
Karl Heuer f8f8b5e8 1994-03-04T22:26:03 *** empty log message ***