lib/regex.h


Log

Author Commit Date CI Message
Paul Eggert f59be416 2018-06-28T12:23:31 regex: port to recently proposed glibc regex merge This patch is inspired by Adhemerval Zanella's recent proposal https://www.sourceware.org/ml/libc-alpha/2018-06/msg00905.html to merge glibc and Gnulib regex. It aims to simplify the merge on the glibc side, without keeping Gnulib portable. * lib/regex.h: Fix a problem with glibc installed-header checking, as follows: (_Restrict_): Prefer __restrict if defined or if GCC 2.95 or later. (_Restrict_arr_): Prefer __restrict_arr if defined, otherwise prefer _Restrict_ if C99 or GCC 3.1 or later (but not C++). * lib/regex_internal.c (re_string_realloc_buffers, build_wcs_buffer) (build_wcs_upper_buffer, build_upper_buffer) (re_string_translate_buffer, re_string_context_at): Move decls here from lib/regex_internal.h, for glibc internal tests. (build_wcs_upper_buffer): Use __wcrtomb, not wcrtomb, fixing glibc BZ #18496. * lib/regex_internal.h (lock_fini) [_LIBC]: Cast to 0 to pacify -Wunused-value. (bitset_set, bitset_clear, bitset_contain, bitset_empty) (bitset_set_all, bitset_copy, bitset_not, bitset_merge) (bitset_mask): Now static inline, and without any __attribute__ ((unused)) decoration, for glibc internal tests.
Paul Eggert 281b825e 2018-01-01T00:57:25 maint: Run 'make update-copyright'
Paul Eggert ca35d468 2017-09-13T00:48:18 all: prefer https: URLs
Paul Eggert a3fd683d 2017-01-01T02:59:23 version-etc: new year * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
Paul Eggert 9b5002be 2016-08-17T17:24:11 regex, string: rename to avoid '__string' * lib/regex.h, lib/string.in.h: Do not use the identifier '__string', as it is effectively reserved by string.h on z/OS.
Paul Eggert d95b819f 2016-04-03T14:01:43 Prefer American spelling for "initialize"
Paul Eggert f97745b0 2016-02-19T09:27:41 regex: make it closer to libc Make Idx a signed type, rather than possibly unsigned. The unsignedness was not really buying us anything, since the code overflows for other reasons before getting to PTRDIFF_MAX. Making it signed allows us to use -1 and -2 with abandon, like libc does, thus lessening the number of differences between gnulib and libc. Also, it should help avoid gratuitous warnings like the one reported by Nelson H. F. Beebe in: http://bugs.gnu.org/22702 * lib/regex.h (__re_idx_t): Remove. All uses changed to regoff_t. * lib/regex_internal.h (SSIZE_MAX): Define if <limits.h> doesn't. (IDX_MAX) [_REGEX_LARGE_OFFSETS]: Now SSIZE_MAX. (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX): Remove. Revert all uses to their libc versions.
Paul Eggert 71090a2a 2016-01-01T00:56:19 version-etc: new year * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
Paul Eggert 5a5a9388 2015-07-04T08:25:21 regex: match current GNU grep behavior These symbols have not matched GNU grep behavior for quite some time. Fix prompted by Balazs Kezes bug report at: http://bugs.gnu.org/20974 * lib/regex.h (RE_SYNTAX_GREP, RE_SYNTAX_EGREP): Change to match current GNU behavior. Simplify by expressing it as differences from POSIX BREs and EREs. (RE_SYNTAX_POSIX_EGREP): No longer differs from GNU behavior.
Paul Eggert b9bfe784 2015-01-01T01:38:23 version-etc: new year * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
Paul Eggert 65776260 2014-06-19T08:22:20 regex: merge patch from libc 2014-02-12 Joseph Myers <joseph@codesourcery.com> Combine __USE_BSD and __USE_SVID into __USE_MISC. * lib/regex.h [__USE_BSD]: Change condition to [__USE_MISC].
Eric Blake 1276a2c5 2014-01-01T00:04:40 maint: update copyright I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 9fc81090 2013-01-01T00:50:58 maint: update all copyright year number ranges Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
Paul Eggert f3155e8a 2012-12-29T21:10:29 regex: merge glibc changes Also, copy the license wording from glibc. This simplifies merging changes. gnulib-tool will change the wording to GPL as appropriate, when importing it to other packages. The only glibc change made since the last merge, which needs merging, is: 2012-05-24 Andreas Schwab <schwab@linux-m68k.org> * lib/regex_internal.h (gettext): Remove use of INTUSE.
Paul Eggert 705a87c9 2012-04-04T00:56:15 regex: remove unnecessary type punning Problem reported by Vladimir Serbinenko in <http://lists.gnu.org/archive/html/bug-gnulib/2012-04/msg00006.html>. * lib/regex.h (struct re_pattern_buffer): Change the type of __REPB_PREFIX(buffer) from unsigned char * to struct re_dfa_t *. Fix comment to match code. * lib/regcomp.c (re_compile_fastmap, re_compile_fastmap_iter, regfree) (re_compile_internal, free_workarea_compile, analyze, lower_subexp) (parse, parse_reg_exp, parse_branch, parse_expression, parse_sub_exp): * lib/regexec.c (regexec, re_search_stub, re_search_internal) (set_regs): Omit no-longer-necessary casts.
Paul Eggert 04ff3c18 2012-03-16T14:17:55 regex: diagnose too-large repeat counts in EREs Previously, the code did not diagnose the too-large repeat count in EREs like 'b{1000000000}'; instead, it silently treated the ERE as if it were 'b\{1000000000}', which is unexpected. * lib/regcomp.c (parse_dup_op): Fail with REG_ESIZE if a repeat count is too large. REG_ESIZE is used nowhere else, and the diagnostic is a reasonable one for this problem. Another option would be to create a new REG_OVERFLOW error for repeat counts that are too large. (fetch_number): Return RE_DUP_MAX + 1, not REG_ERROR, if the repeat count is too large, so that the caller can distinguish the two cases. * lib/regex.h (_REG_ESIZE): Document that this is now a generic "Too large" return code, and that repeat counts are one example of this.
Paul Eggert f9d2fe25 2012-03-10T12:15:44 regex: allow inclusion of <regex.h> before <limits.h> Without this patch, portable programs had to include <limits.h> before <regex.h> if they wanted a consistent value for RE_DUP_MAX. I ran into this problem with a test version of GNU grep on Solaris 8. * lib/regex.h: Include <limits.h> if _REGEX_INCLUDE_LIMITS_H. This is done conditionally so that this change can be merged back to glibc. * m4/regex.m4 (gl_REGEX): Define _REGEX_INCLUDE_LIMITS_H if using the included regex.
Paul Eggert 341111f6 2012-02-09T21:39:05 maint: replace FSF snail-mail addresses with URLs * config/argz.mk, lib/accept4.c, lib/alignof.h, lib/alloca.in.h: * lib/alphasort.c, lib/arcfour.c, lib/arcfour.h, lib/arctwo.c: * lib/arctwo.h, lib/argz.c, lib/arpa_inet.in.h, lib/asnprintf.c: * lib/asprintf.c, lib/assert.in.h, lib/base32.c, lib/base32.h: * lib/base64.c, lib/base64.h, lib/c-ctype.c, lib/c-ctype.h: * lib/c-strcase.h, lib/c-strcasecmp.c, lib/c-strncasecmp.c: * lib/check-version.c, lib/check-version.h, lib/config.charset: * lib/ctype.in.h, lib/des.c, lib/des.h, lib/dup3.c, lib/errno.in.h: * lib/float+.h, lib/fnmatch.c, lib/fnmatch.in.h, lib/fnmatch_loop.c: * lib/fseeko.c, lib/gai_strerror.c, lib/gc-gnulib.c: * lib/gc-libgcrypt.c, lib/gc-pbkdf2-sha1.c, lib/gc.h: * lib/getaddrinfo.c, lib/getdelim.c, lib/getfilecon.c, lib/getline.c: * lib/getlogin_r.c, lib/getpass.c, lib/getpass.h, lib/gettext.h: * lib/gettimeofday.c, lib/glob.in.h, lib/glthread/cond.c: * lib/glthread/cond.h, lib/glthread/lock.c, lib/glthread/lock.h: * lib/glthread/thread.c, lib/glthread/thread.h: * lib/glthread/threadlib.c, lib/glthread/yield.h, lib/hmac-md5.c: * lib/hmac-sha1.c, lib/hmac.h, lib/iconv.c, lib/iconv.in.h: * lib/iconv_close.c, lib/iconv_open.c, lib/inet_ntop.c, lib/isfinite.c: * lib/isinf.c, lib/iswblank.c, lib/langinfo.in.h, lib/link.c: * lib/localcharset.c, lib/localcharset.h, lib/lseek.c, lib/malloc.c: * lib/malloca.c, lib/malloca.h, lib/md2.c, lib/md2.h, lib/md4.c: * lib/md4.h, lib/md5.c, lib/md5.h, lib/memmem.c, lib/mempcpy.c: * lib/memset.c, lib/memxor.c, lib/memxor.h, lib/minmax.h, lib/mktime.c: * lib/msvc-inval.c, lib/msvc-inval.h, lib/msvc-nothrow.c: * lib/msvc-nothrow.h, lib/netdb.in.h, lib/netinet_in.in.h, lib/nproc.c: * lib/nproc.h, lib/obstack_printf.c, lib/pathmax.h, lib/pipe.c: * lib/pipe2.c, lib/poll.c, lib/poll.in.h, lib/printf-args.c: * lib/printf-args.h, lib/printf-parse.c, lib/printf-parse.h: * lib/pselect.c, lib/pthread.in.h, lib/pty-private.h, lib/pty.in.h: * lib/read-file.c, lib/read-file.h, lib/ref-add.sin, lib/ref-del.sin: * lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c: * lib/regex_internal.h, lib/regexec.c, lib/rijndael-alg-fst.c: * lib/rijndael-alg-fst.h, lib/rijndael-api-fst.c: * lib/rijndael-api-fst.h, lib/rint.c, lib/rintf.c, lib/rintl.c: * lib/round.c, lib/roundf.c, lib/roundl.c, lib/scandir.c, lib/select.c: * lib/sha1.c, lib/sha1.h, lib/size_max.h, lib/snprintf.c: * lib/stdalign.in.h, lib/stdarg.in.h, lib/stdbool.in.h: * lib/stddef.in.h, lib/stdint.in.h, lib/stdio.in.h, lib/str-kmp.h: * lib/str-two-way.h, lib/strcasecmp.c, lib/strcasestr.c, lib/strdup.c: * lib/striconv.c, lib/striconv.h, lib/string.in.h, lib/strings.in.h: * lib/strncasecmp.c, lib/strndup.c, lib/strnlen.c, lib/strpbrk.c: * lib/strptime.c, lib/strsep.c, lib/strstr.c, lib/strverscmp.c: * lib/sys_file.in.h, lib/sys_ioctl.in.h, lib/sys_select.in.h: * lib/sys_socket.in.h, lib/sys_stat.in.h, lib/sys_time.in.h: * lib/sys_times.in.h, lib/sys_types.in.h, lib/sys_uio.in.h: * lib/sys_utsname.in.h, lib/sys_wait.in.h, lib/tcgetsid.c: * lib/termios.in.h, lib/time.in.h, lib/time_r.c, lib/timegm.c: * lib/times.c, lib/unictype/3level.h, lib/unictype/3levelbit.h: * lib/unistd.in.h, lib/vasnprintf.c, lib/vasnprintf.h, lib/vasprintf.c: * lib/vsnprintf.c, lib/waitpid.c, lib/wchar.in.h, lib/wctype.in.h: * lib/xsize.h, tests/test-closein.c, tests/test-des.c: * tests/test-fclose.c, tests/test-fgetc.c, tests/test-filevercmp.c: * tests/test-fputc.c, tests/test-fread.c, tests/test-fwrite.c: * tests/test-gc-arcfour.c, tests/test-gc-arctwo.c, tests/test-gc-des.c: * tests/test-gc-hmac-md5.c, tests/test-gc-hmac-sha1.c: * tests/test-gc-md2.c, tests/test-gc-md4.c, tests/test-gc-md5.c: * tests/test-gc-pbkdf2-sha1.c, tests/test-gc-rijndael.c: * tests/test-gc-sha1.c, tests/test-gc.c, tests/test-getdelim.c: * tests/test-getline.c, tests/test-getndelim2.c, tests/test-md2.c: * tests/test-md4.c, tests/test-parse-datetime.c, tests/test-perror.c: * tests/test-perror2.c, tests/test-pipe.c, tests/test-pipe2.c: * tests/test-poll.c, tests/test-quotearg-simple.c: * tests/test-quotearg.c, tests/test-quotearg.h: * tests/test-round-ieee.c, tests/test-round1.c: * tests/test-roundf-ieee.c, tests/test-roundf1.c: * tests/test-roundl-ieee.c, tests/test-roundl.c: * tests/test-safe-alloc.c, tests/test-sigpipe.c: * tests/test-spawn-pipe-child.c, tests/test-spawn-pipe-main.c: * tests/test-strerror.c, tests/test-strerror_r.c: * tests/test-strsignal.c, tests/test-strverscmp.c: * tests/test-xmemdup0.c: Replace FSF snail mail addresses with URLs, as per GNU coding standards. See glibc bug <http://sourceware.org/bugzilla/show_bug.cgi?id=13673>.
Paul Eggert 5a460138 2012-02-07T22:47:01 regex: merge glibc changes * lib/regcomp.c (init_dfa): Tighten overflow checks to test for IDX_MAX too, since IDX_MAX can be much less than SIZE_MAX. (init_word_char): Work even if bitset words are not exactly 32 or 64 bits wide. Don't assume there are no padding bits. * lib/regex.c [_LIBC]: Do not include <config.h>. [!_LIBC]: Add pragmas to ignore -Wsuggest-attributes=pure and -Wtype-limits. * lib/regex.h (__USE_GNU): Renamed from __USE_GNU_REGEX, to avoid needless disagreement with glibc. All uses changed. Define it to 1 only if _GNU_SOURCE, to match glibc. (_REG_RM_NAME): Remove; no longer needed, since the names in question are now all protected by __USE_GNU. (_REG_RE_NAME): Remove; replaced by glibc's __REPB_PREFIX. (REG_TRANSLATE_TYPE): Remove; replaced by glibc's __RE_TRANSLATE_TYPE. * lib/regex_internal.h (MIN): New macro. 2012-01-03 Ulrich Drepper <drepper@gmail.com> * lib/regcomp.c (init_word_char): Optimize regex a bit. 2011-12-30 Jakub Jelinek <jakub@redhat.com> * lib/regex_internal.c (re_string_fetch_byte_case): Fix up regcomp/regexec. The problem is that parse_bracket_symbol is miscompiled, and it turns out it is because of an incorrect attribute on re_string_fetch_byte_case. Unlike re_string_peek_byte_case, this one is really not pure, it modifies memory (increments pstr->cur_idx), and with the pure attribute GCC assumed it doesn't and it cached the presumed value of regexp->cur_idx in a variable across the for (;; ++i) { if (i >= BRACKET_NAME_BUF_SIZE) return REG_EBRACK; if (token->type == OP_OPEN_CHAR_CLASS) ch = re_string_fetch_byte_case (regexp); else ch = re_string_fetch_byte (regexp); if (re_string_eoi(regexp)) return REG_EBRACK; if (ch == delim && re_string_peek_byte (regexp, 0) == ']') break; elem->opr.name[i] = ch; } 2011-11-29 Andreas Schwab <schwab@redhat.com> * lib/regcomp.c (build_equiv_class): Fix access after end of search string in regex matcher. 2011-11-12 Ulrich Drepper <drepper@redhat.com> * lib/regex_internal.c, lib/regex_internal.h: Fix warnings in regex. 2011-10-12 Ulrich Drepper <drepper@redhat.com> * lib/regcomp.c (parse_branch): One more regex memory leak fixed. 2011-10-11 Ulrich Drepper <drepper@redhat.com> * lib/regcomp.c (parse_branch, parse_sub_exp): More regex memory leak fixes and tests. (parse_sub_exp, parse_bracket_exp): Fix memory leak for some invalid regular expressions. 2011-05-28 Ulrich Drepper <drepper@gmail.com> * lib/regex_internal.c, lib/regexec.c: Fix unnecessary overallocation due to incomplete character. When incomplete characters are found at the end of a string the code ran amok and allocated lots of memory. Stricter limits are now in place. 2011-05-20 Reuben Thomas <rrt@sc3d.org> * lib/regex.h: Update documentation. 2011-05-16 Aharon Robbins <arnold@skeeve.com> * lib/regex.h: Update RE_SYNTAX*_AWK constants. 2010-05-05 Andreas Schwab <schwab@redhat.com> * lib/regexec.c (find_collation_sequence_value): Fix lookup of collation sequence value during regexp matching. 2010-01-22 Ulrich Drepper <drepper@redhat.com> * lib/regex_internal.c (re_dfa_add_node): Extend overflow detection. 2008-01-16 Ulrich Drepper <drepper@redhat.com> * lib/regex.h: Cleanup namespace. 2007-11-26 Ulrich Drepper <drepper@redhat.com> * lib/regex.h (REG_ENOSYS): Define REG_ENOSYS also for __USE_XOPEN2K. 2007-08-26 Ulrich Drepper <drepper@redhat.com> * lib/regex_internal.h: Prevent some declarations and definitions to be seen when used in tests. 2005-05-06 Ulrich Drepper <drepper@redhat.com> * lib/regex_internal.h: Include bits/libc-lock.h or define dummy __libc_lock_* macros if not _LIBC. (struct re_dfa_t): Add lock.
Paul Eggert 51e801f2 2012-01-05T23:53:49 In commentary, do not use ` to quote.
Jim Meyering 1602f0af 2012-01-01T10:04:58 maint: update all copyright year number ranges Run "make update-copyright".
Daniel Richard G d1a06d87 2011-10-18T20:32:42 Support for old NeXTstep 3.3 gcc. * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Write 'defined __STRICT_ANSI__', not '__STRICT_ANSI__'. * lib/math.in.h (_GL_NUM_UINT_WORDS etc.): Likewise. * lib/spawn.in.h (_Restrict_arr_): Likewise. * lib/regex.h (_Restrict_arr_): Likewise. * lib/regex_internal.h (re_token_t): Likewise. * lib/regexec.c (check_node_accept_bytes): Likewise. * tests/test-printf-posix.c (func1, func2, func3, func4): Likewise.
Jim Meyering d60f3b0c 2011-01-01T20:17:23 maint: update almost all copyright ranges to include 2011 Run the new "make update-copyright" rule.
Karl Berry 29c7cb2d 2010-09-07T17:44:22 regex documentation update from Reuben Thomas <rrt@sc3d.org>, 20 Aug 2010 12:04:39 +0100
Jim Meyering b2e2010c 2010-01-01T10:31:12 update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
Jim Meyering 3030c5b5 2009-12-28T10:50:36 update nearly all FSF copyright year lists to include 2009 The files named by the following are exempted: grep -v '^#' config/srclist.txt|grep -v '^$' \ | while read src dst; do test -f "$dst" && { echo "$dst"; continue; } test -d "$dst" || continue echo "$dst"/$(basename "$src") done > exempt git ls-files tests/unictype >> exempt In the remaining files, convert to all-interval notation if - there is already at least one year interval like 2000-2003 - the file is maintained by me - the file is in lib/uni*/, where that style already prevails Otherwise, use update-copyright's default.
Paul Eggert ad431555 2007-01-29T00:37:14 * lib/regex.h (_Restrict_): Renamed from __restrict, to avoid a circularity problem with HP-UX ia64 reported by Bob Proulx in <http://lists.gnu.org/archive/html/bug-gnulib/2007-01/msg00394.html>. All uses changed. (_Restrict_arr_): Renamed from __restrict_arr, for similar reasons. All uses changed. * lib/regcomp.c, lib/regexec.c: Change all uses from __restrict to _Restrict_. * lib/regexec.c (regexec): Declare pmatch with _Restrict_arr_, so that the parameter matches the prototype.
Paul Eggert ec5206cf 2006-11-27T19:41:42 * lib/regex.h (__restrict_arr): Redo logic of #if, for clarity.
Paul Eggert 564569a4 2006-11-27T07:15:26 Fix some incompatibilities with gcc -ansi -pedantic. * lib/regex.h (__restrict_arr): Don't use the [restrict] syntax if compiling pedantically with GCC, unless it's C99 or later. Don't trust sys/cdefs.h's definition of __restrict_arr, either, as it mishandles gcc -ansi -pedantic as well. * lib/regex_internal.h (re_token_t): Don't use enum bitfields if gcc -pedantic. * lib/regexec.c (check_node_accept_bytes): Don't use auto initializers for struct if -pedantic, unless it's C99 or later.
Paul Eggert ce0f0550 2006-08-10T20:08:01 Import the following changes from libc: 2006-06-02 Jakub Jelinek <jakub@redhat.com> * posix/regex_internal.c (re_string_skip_chars): If no character has been converted at all, set *last_wc to WEOF. If mbrtowc failed, set wc to the byte which couldn't be converted. (re_string_reconstruct): Don't clear valid_raw_len before calling re_string_skip_chars. If wc is WEOF after re_string_skip_chars, set tip_context using re_string_context_at. 2006-05-02 Ulrich Drepper <drepper@redhat.com> * posix/regex.h: g++ still cannot handled [restrict]. 2006-04-21 Ulrich Drepper <drepper@redhat.com> * posix/regex.h: Remove special handling for VMS.
Paul Eggert 4a2097ae 2006-04-13T22:14:12 * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N is not defined. Problem reported by Mark D. Baushke via Derek R. Price. * regex.h (RE_DUP_MAX): Update comment to match current implementation.
Paul Eggert 8335a4d6 2006-04-10T06:43:33 Merge regex changes from libc, removing some of our POSIX-conformance changes that were rejected and redoing them in a less-intrusive way. * lib/regcomp.c (re_compile_internal, init_dfa): Length arg is now size_t, not Idx. All uses changed. (peek_token): Forward decl now says internal_function. (__re_error_msgid, __re_error_msgid_idx): Now static rather than extern with attribute_hidden. (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn. For some reason libc prefers K&R style defns for external functions. (regerror) [!defined _LIBC]: Likewise. (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp): (seek_collating_symbol_entry, lookup_collation_sequence_value): (build_range_exp, build_collating_symbol): Use K&R-style defn. (re_compile_fastmap): Use '\0' to memset, not 0. (utf8_sb_map): Make the calculations more obvious. (init_dfa, parse_bracket_exp, build_charclass_op): Call calloc and cast result, as glibc does. (init_word_char, fetch_token, peek_token, peek_token_bracket): (build_range_exp, build_collating_symbol): Now internal functions. * lib/regex.c [!defined _LIBC]: Allow compiling with C++ compilers. * lib/regex.h (__USE_GNU_REGEX): New macro. Don't depend on _REGEX_SOURCE any more; depend on _GNU_SOURCE instead. Don't depend on VMS; depend on __VMS instead, for POSIX namespace cleanness. (regoff_t): Define to ssize_t, not long int. Remove the REG_ macros named below. Instead, make the old names (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if __USE_GNU_REGEX. (REG_BACKSLASH_ESCAPE_IN_LISTS): (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS): (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS): (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE): (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT): (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS): (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES): (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING): (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD): (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE): (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS): (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK): (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP): (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON): (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC): (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED): (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED): (REG_NREGS): Remove. All uses replaced by the old RE_* names. (RE_BACKSLASH_ESCAPE_IN_LISTS): (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS): (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS): (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE): (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT): (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS): (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES): (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING): (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD): (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE): (RE_CONTEXT_INVALID_DUP, RE_NO_SUB): Don't bother having these macros be independent of each others' values, since they no longer exist in the POSIX name space. Rename the following member names back to their old names, unless !__USE_GNU_REGEX. All uses changed back. (buffer): Renamed from re_buffer. (allocated): Renamed from re_allocated. (used): Renamed from re_used. (syntax): Renamed from re_syntax. (fastmap): Renamed from re_fastmap. (translate): Renamed from re_translate. (can_be_null): Renamed from re_can_be_null. (regs_allocated): Renamed from re_regs_allocated. (fastmap_accurate): Renamed from re_fastmap_accurate. (no_sub): Renamed from re_no_sub. (not_bol): Renamed from re_not_bol. (not_eol): Renamed from re_not_eol. (newline_anchor): Renamed from re_newline_anchor. (num_regs): Renamed from rm_num_regs. (start): Renamed from rm_start. (end): Renamed from rm_end. (free_state): Move up a bit. * lib/regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]: #define to be empty. (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2 when that is what is intended. (SBC_MAX): Define to UCHAR_MAX + 1, not 256. (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed. (MAX): New macro. (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove. All uses changed back to re_malloc, etc. It's now the caller's responsibility to check for overflow; all callers changed. (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc): (re_x2nrealloc): Remove. (free_state): Remove decl. * lib/regexc.c (regexec, re_match, re_search, re_match_2, re_search_2): (re_set_registers, re_exec): Use K&R-style defn. 2006-01-31 Roland McGrath <roland@redhat.com> * lib/regcomp.c (calc_eclosure_iter): Remove dead variables. Reported by Mike Frysinger <vapier@gentoo.org>. 2006-01-15 Andreas Jaeger <aj@suse.de> [BZ #1950] * lib/regex_internal.c (re_string_reconstruct): Adjust for build_wcs_upper_buffer change. (build_wcs_upper_buffer): Change return type. 2005-12-10 Ulrich Drepper <drepper@redhat.com> * lib/regex_internal.h: Include <stdint.h> if available. 2005-12-06 Paolo Bonzini <bonzini@gnu.org> * lib/regex_internal.h (SIZE_MAX): Provide a default definition. 2005-10-14 Ulrich Drepper <drepper@redhat.com> * lib/regcomp.c: Adjust for changed secondary hash function. 2005-09-30 Ulrich Drepper <drepper@redhat.com> * lib/regex.h: Pretty printing. Clean up namespace a bit. 2005-09-30 Jakub Jelinek <jakub@redhat.com> * lib/regexec.c (update_cur_sifted_state, check_arrival, check_arrival_add_next_nodes): Avoid using uninitialized variable. 2005-09-06 Paul Eggert <eggert@cs.ucla.edu> Ulrich Drepper <drepper@redhat.com> [BZ #1302] * lib/regex_internal.h (bitset_t): Renamed from bitset. All uses changed. (bitset_word_t): Renamed from bitset_word. All uses changed. 2005-09-22 Ulrich Drepper <drepper@redhat.com> [BZ #281] * lib/regex.h: Define RE_TRANSLATE_TYPE as unsigned char *. * lib/regcomp.c: Remove unnecessary uses of unsigned RE_TRANSLATE_TYPE. * lib/regex_internal.h: Likewise. * lib/regex_internal.c: Likewise. * lib/regexec.c: Likewise. Based on a patch by Stepan Kasal <kasal@ucw.cz>. 2005-09-07 Ulrich Drepper <drepper@redhat.com> * lib/regexec.c (find_recover_state): Remove unnecessary initialization. (transit_state_bkref): Make DFA a const pointer. (get_subexp): Likewise. (check_arrival): Likewise. (update_cur_sifted_state): Likewise. (re_search_internal): Likewise. (prune_impossible_nodes): Likewise. (acquire_init_state_context): Likewise. (proceed_next_node): Likewise. (set_regs): Likewise. (free_fail_stack_return): Likewise. (check_arrival_expand_ecl): Mark DFA parameter as const. (check_arrival_expand_ecl_sub): Likewise. (check_subexp_limits): Likewise. (sub_epsilon_src_nodes): Likewise. (add_epsilon_src_nodes): Likewise. (merge_state_array): Likewise. (update_regs): Likewise. (build_trtable): Likewise. (sift_states_backward): Mark MCTX parameter as const. (build_sifted_states): Likewise. (update_cur_sifted_state): Likewise. (sift_states_mkref): Likewise. (check_arrival_expand_ecl): Mark eclosure as const. (check_dst_limits_calc_pos_1): Likewise. * lib/regex_internal.h (re_match_context_t): Make dfa a const pointer. 2005-09-06 Ulrich Drepper <drepper@redhat.com> * lib/regexec.c (merge_state_with_log): Define dfa as const pointer. (transit_state_sb): Likewise. (transit_state_mb): Likewise. (sift_states_iter_mb): Likewise. (check_arrival_add_next_nodes): Likewise. (check_node_accept_bytes): Change first parameter to pointer-to-const. [_LIBC] (re_search_2_stub): Use mempcpy. * lib/regex_internal.c (re_string_reconstruct): Avoid calling mbrtowc for very simple UTF-8 case. * lib/regex_internal.c (re_acquire_state): Make DFA pointer arg a pointer-to-const. (re_acquire_state_context): Likewise. * lib/regex_internal.h: Adjust prototypes. * lib/regex.c: Prevent using C++ compilers. * lib/regex_internal.c (re_acquire_state): Minor code rearrangement. (re_acquire_state_context): Likewise.
Paul Eggert c0174c2f 2006-03-17T07:26:42 * lib/regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Typedef to long int, not to off_, as POSIX will likely change in that direction. * m4/regex.m4 (gl_REGEX): Don't check for off_t, since the code no longer needs it. Instead, check that regoff_t is as least as wide as ptrdiff_t. Don't define _REGEX_WIDE_OFFSETS unless using the included regex, so that our regex.h stays compatible with the installed regex. This is helpful for installers who configure --without-included-regex. Problem reported by Emanuele Giaquinta.
Paul Eggert 28492cce 2005-08-31T22:51:09 On 64-bit hosts (where size_t is 64 bits and int is 32 bits), the old glibc regex code mishandles strings longer than 2**31 bytes. This patch fixes this when the regex code is used in gnulib (i.e., outside glibc). * lib/regex.h (_REGEX_LARGE_OFFSETS): New feature-test macro, governing whether the rest of this patch is active. By default, the macro is disabled and the patch has no effect. (regoff_t) [defined _REGEX_LARGE_OFFSETS]: Define to off_t, not int. (__re_idx_t, __re_size_t, __re_long_size_t): New types. (struct re_pattern_buffer, re_search, re_search_2, re_match): (re_match_2, re_set_registers): Use the new types. * lib/regex_internal.h (Idx, re_hashval_t): New types. (REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX): New macros. (re_node_set, re_charset_t, re_token_t, re_string_realloc_buffers): (re_string_context_at, bin_tree_t, re_dfastate_t): (struct re_state_table_entry, state_array_t, re_sub_match_last_t): (re_sub_match_top_t, re_match_context_t, re_sift_context_t): (struct re_fail_stack_ent_t, struct re_fail_stack_t, struct re_dfa_t): (re_string_char_size_at, re_string_wchar_at): (re_string_elem_size_at): Use the new types and macros to port to 64-bit hosts. Use unsigned types for internal values, so that the code mostly works even for arrays larger than SSIZE_MAX. * lib/regcomp.c (re_compile_internal, init_dfa, duplicate_node): (search_duplicated_node, calc_eclosure_iter, fetch_number): (parse_reg_exp, parse_branch, parse_expression, parse_sub_exp): (build_equiv_class, build_charclass, re_compile_fastmap_iter): (free_dfa_content, create_initial_state, optimize_utf8, analyze): (optimize_subexps, calc_first, link_nfa_nodes, duplicate_node_closure): (calc_inveclosure, parse_dup_op, build_range_exp): (build_collating_symbol, parse_bracket_exp, build_charclass_op): (fetch_number, create_token_tree, mark_opt_subexp): Likewise. * lib/regex_internal.c (re_string_construct_common, create_ci_newstate): (create_cd_newstate, re_string_allocate, re_string_construct): (re_string_realloc_buffers, build_wcs_upper_buffer): (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer): (re_string_reconstruct, re_string_peek_byte_case): (re_string_fetch_byte_case, re_string_context_at): (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2): (re_node_set_init_copy, re_node_set_add_intersect): (re_node_set_init_union, re_node_set_merge, re_node_set_insert): (re_node_set_insert_last, re_node_set_compare, re_node_set_contains): (re_node_set_remove_at, re_dfa_add_node, calc_state_hash): (re_acquire_state, re_acquire_state_context, register_state): Likewise. * lib/regex.c (match_ctx_init, match_ctx_add_entry, search_cur_bkref_entry): (match_ctx_add_subtop, match_ctx_add_sublast, sift_ctx_init): (re_search_internal, re_search_2_stub, re_search_stub) (re_copy_regs, check_matching, check_halt_state_context, update_regs): (push_fail_stack, sift_states_iter_mb, build_sifted_states): (update_cur_sifted_state, check_dst_limits): (check_dst_limits_calc_pos_1, check_dst_limits_calc_pos): (check_subexp_limits, sift_states_bkref, merge_state_array): (check_subexp_matching_top, get_subexp, get_subexp_sub): (find_subexp_node, check_arrival, check_arrival_add_next_nodes): (check_arrival_expand_ecl, check_arrival_expand_ecl_sub): (expand_bkref_cache, check_node_accept_bytes): (group_nodes_into_DFAstates, check_node_accept, regexec, re_match): (re_search, re_match_2, re_search_2, prune_impossible_nodes): (acquire_init_state_context, check_halt_node_context): (proceed_next_node, pop_fail_stack, set_regs, free_fail_stack_return): (sift_states_backward, clean_state_log_if_needed): (sub_epsilon_src_nodes, add_epsilone_src_nodes, merge_state_with_log): (find_recover_state, transit_state_sb, transit_state_mb): (transit_state_bkref, build_trtable, match_ctx_clean): Likewise. * lib/regcomp.c (parse_dup_op): Add an extra test if Idx is unsigned, to work around an assumption that REG_MISSING is negative. * m4/regex.m4 (gl_REGEX): Require AC_SYS_LARGEFILE, Define _REGEX_LARGE_OFFSETS). Test for regoff_t/off_t bug in 64-bit and large-file glibc and in 32-bit large-file Solaris. * config/srclist.txt: Add glibc bug 1281.
Paul Eggert 083768e3 2005-08-25T05:08:59 * config/srclist.txt: Add glibc bug 1240. * lib/regcomp.c (regerror): 2nd arg is 'restrict', as per POSIX. * lib/regex.h (regerror): Likewise.
Paul Eggert dad0bacf 2005-08-24T23:09:33 [_REGEX_SOURCE]: Define re_fastmap_accurate too; this was inadvertently omitted from the previous patch.
Paul Eggert d6103c5e 2005-08-24T22:29:38 * config/srclist.txt: Remove glibc bug 1233 and add 1236, which supersedes it. * lib/regex.h: Fix a multitude of POSIX name space violations. These changes have an effect only for programs that define _POSIX_C_SOURCE, _POSIX_SOURCE, or _XOPEN_SOURCE; they do not change anything for programs compiled in the normal way. Also, there is no effect on the ABI. (_REGEX_SOURCE): New macro. Do not include <stddef.h> if _XOPEN_SOURCE and VMS are both defined and _GNU_SOURCE is not; this fixes a name space violation. Rename the following macros to obey POSIX requirements. The old names are still visible as macros if _REGEX_SOURCE is defined. (REG_BACKSLASH_ESCAPE_IN_LISTS): renamed from RE_BACKSLASH_ESCAPE_IN_LISTS. (REG_BK_PLUS_QM): renamed from RE_BK_PLUS_QM. (REG_CHAR_CLASSES): renamed from RE_CHAR_CLASSES. (REG_CONTEXT_INDEP_ANCHORS): renamed from RE_CONTEXT_INDEP_ANCHORS. (REG_CONTEXT_INDEP_OPS): renamed from RE_CONTEXT_INDEP_OPS. (REG_CONTEXT_INVALID_OPS): renamed from RE_CONTEXT_INVALID_OPS. (REG_DOT_NEWLINE): renamed from RE_DOT_NEWLINE. (REG_DOT_NOT_NULL): renamed from RE_DOT_NOT_NULL. (REG_HAT_LISTS_NOT_NEWLINE): renamed from RE_HAT_LISTS_NOT_NEWLINE. (REG_INTERVALS): renamed from RE_INTERVALS. (REG_LIMITED_OPS): renamed from RE_LIMITED_OPS. (REG_NEWLINE_ALT): renamed from RE_NEWLINE_ALT. (REG_NO_BK_BRACES): renamed from RE_NO_BK_BRACES. (REG_NO_BK_PARENS): renamed from RE_NO_BK_PARENS. (REG_NO_BK_REFS): renamed from RE_NO_BK_REFS. (REG_NO_BK_VBAR): renamed from RE_NO_BK_VBAR. (REG_NO_EMPTY_RANGES): renamed from RE_NO_EMPTY_RANGES. (REG_UNMATCHED_RIGHT_PAREN_ORD): renamed from RE_UNMATCHED_RIGHT_PAREN_ORD. (REG_NO_POSIX_BACKTRACKING): renamed from RE_NO_POSIX_BACKTRACKING. (REG_NO_GNU_OPS): renamed from RE_NO_GNU_OPS. (REG_DEBUG): renamed from RE_DEBUG. (REG_INVALID_INTERVAL_ORD): renamed from RE_INVALID_INTERVAL_ORD. (REG_IGNORE_CASE): renamed from RE_ICASE. This renaming is a bit unusual, since we can't clash with the POSIX REG_ICASE. (REG_CARET_ANCHORS_HERE): renamed from RE_CARET_ANCHORS_HERE. (REG_CONTEXT_INVALID_DUP): renamed from RE_CONTEXT_INVALID_DUP. (REG_NO_SUB): renamed from RE_NO_SUB. (REG_SYNTAX_EMACS): renamed from RE_SYNTAX_EMACS. (REG_SYNTAX_AWK): renamed from RE_SYNTAX_AWK. (REG_SYNTAX_GNU_AWK): renamed from RE_SYNTAX_GNU_AWK. (REG_SYNTAX_POSIX_AWK): renamed from RE_SYNTAX_POSIX_AWK. (REG_SYNTAX_GREP): renamed from RE_SYNTAX_GREP. (REG_SYNTAX_EGREP): renamed from RE_SYNTAX_EGREP. (REG_SYNTAX_POSIX_EGREP): renamed from RE_SYNTAX_POSIX_EGREP. (REG_SYNTAX_ED): renamed from RE_SYNTAX_ED. (REG_SYNTAX_SED): renamed from RE_SYNTAX_SED. (_REG_SYNTAX_POSIX_COMMON): renamed from _RE_SYNTAX_POSIX_COMMON. (REG_SYNTAX_POSIX_BASIC): renamed from RE_SYNTAX_POSIX_BASIC. (REG_SYNTAX_POSIX_MINIMAL_BASIC): renamed from RE_SYNTAX_POSIX_MINIMAL_BASIC. (REG_SYNTAX_POSIX_EXTENDED): renamed from RE_SYNTAX_POSIX_EXTENDED. (REG_SYNTAX_POSIX_MINIMAL_EXTENDED): renamed from RE_SYNTAX_POSIX_MINIMAL_EXTENDED. (REG_DUP_MAX): renamed from RE_DUP_MAX. No need to undef it. (REG_UNALLOCATED): Renamed from REGS_UNALLOCATED. (REG_REALLOCATE): Renamed from REGS_REALLOCATE. (REG_FIXED): Renamed from REGS_FIXED. (REG_NREGS): Renamed from RE_NREGS. (REG_ICASE, REG_NEWLINE, REG_NOSUB): Do not depend on the values of other REG_* macros, since POSIX says the user is allowed to #undef these macros selectively. (reg_errcode_t): Update comment stating what other tables need to be consistent. Rename the following enum values to obey POSIX requirements. The old names are still visible as macros. (_REG_ENOSYS): Renamed from REG_ENOSYS. Define even if _XOPEN_SOURCE is not defined, since GNU is supposed to be a superset of POSIX as much as possible, and since we want reg_errcode_t to be a signed type for implementation consistency. (_REG_NOERROR): Renamed from REG_NOERROR. (_REG_NOMATCH): Renamed from REG_NOMATCH. (_REG_BADPAT): Renamed from REG_BADPAT. (_REG_ECOLLATE): Renamed from REG_ECOLLATE. (_REG_ECTYPE): Renamed from REG_ECTYPE. (_REG_EESCAPE): Renamed from REG_EESCAPE. (_REG_ESUBREG): Renamed from REG_ESUBREG. (_REG_EBRACK): Renamed from REG_EBRACK. (_REG_EPAREN): Renamed from REG_EPAREN. (_REG_EBRACE): Renamed from REG_EBRACE. (_REG_BADBR): Renamed from REG_BADBR. (_REG_ERANGE): Renamed from REG_ERANGE. (_REG_ESPACE): Renamed from REG_ESPACE. (_REG_BADRPT): Renamed from REG_BADRPT. (_REG_EEND): Renamed from REG_EEND. (_REG_ESIZE): Renamed from REG_ESIZE. (_REG_ERPAREN): Renamed from REG_ERPAREN. (REG_ENOSYS, REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE): (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN): (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND): (REG_ESIZE, REG_ERPAREN): Now macros, not enum constants. (_REG_RE_NAME, _REG_RM_NAME): New macros. (REG_TRANSLATE_TYPE): Renamed from RE_TRANSLATE_TYPE. All uses changed. But support the old name if the new one is not defined and if _REGEX_SOURCE. Change the following member names in struct re_pattern_buffer. The old names are still supported if !_REGEX_SOURCE. The new names are always supported, regardless of _REGEX_SOURCE. (re_buffer): Renamed from buffer. (re_allocated): Renamed from allocated. (re_used): Renamed from used. (re_syntax): Renamed from syntax. (re_fastmap): Renamed from fastmap. (re_translate): Renamed from translate. (re_can_be_null): Renamed from can_be_null. (re_regs_allocated): Renamed from regs_allocated. (re_fastmap_accurate): Renamed from fastmap_accurate. (re_no_sub): Renamed from no_sub. (re_not_bol): Renamed from not_bol. (re_not_eol): Renamed from not_eol. (re_newline_anchor): Renamed from newline_anchor. Change the following member names in struct re_registers. The old names are still supported if !_REGEX_SOURCE. The new names are always supported, regardless of _REGEX_SOURCE. (rm_num_regs): Renamed from num_regs. (rm_start): Renamed from start. (rm_end): Renamed from end. (re_set_syntax, re_compile_pattern, re_compile_fastmap): (re_search, re_search_2, re_match, re_match_2, re_set_registers): Prepend __ to parameter names.
Paul Eggert 9828dc4e 2005-08-23T20:37:24 * config/srclist.txt: Add glibc bug 1233. * lib/regex.h (REG_NOSYS) [!defined _XOPEN_SOURCE && 200112L <= _POSIX_C_SOURCE]: Define, since POSIX requires it as of 2001. (_REG_ENOSYS) [! (defined _XOPEN_SOURCE || 200112L <= _POSIX_C_SOURCE)]: New private symbol, used to keep the enum signed in all cases.
Paul Eggert b5fb7004 2005-08-23T19:11:45 * config/srclist.txt: Add glibc bug 1232. * lib/regex.h (RE_NO_EMPTY_RANGES): Fix doc bug reported by James Youngman in <http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00132.html>.
Paul Eggert 087e9e5b 2005-08-20T07:42:15 * config/srclist.txt: Add glibc bugs 1220, 1221, 1222. * lib/regcomp.c: (re_compile_pattern, re_set_syntax, re_compile_fastmap): (re_compile_fastmap_iter, regcomp, regerror, regfree): (re_compile_internal, init_dfa, init_word_char, free_workarea_compile): (create_initial_state, optimize_utf8, analyze, postorder, preorder): (optimize_subexps, lower_subexps, lower_subexp, calc_first, calc_next): (link_nfa_nodes, duplicate_node_closure, search_duplicated_node): (duplicate_node, calc_inveclosure, calc_eclosure, calc_eclosure_iter): (fetch_token, peek_token, peek_token_bracket, parse, parse_reg_exp): (parse_branch, parse_expression, parse_sub_exp, parse_dup_op): (build_range_exp, build_collating_symbol, parse_bracket_exp): (parse_bracket_element, parse_bracket_symbol, build_equiv_class): (build_charclass, build_charclass_op, fetch_number, create_tree): (create_token_tree, mark_opt_subexp, duplicate_tree): Use prototypes rather than old-style definitions. * lib/regex_internal.c: (re_string_allocate, re_string_construct, re_string_realloc_buffers): (re_string_construct_common, build_wcs_buffer, build_wcs_upper_buffer): (re_string_skip_chars, build_upper_buffer, re_string_translate_buffer): (re_string_reconstruct, re_string_peek_byte_case): (re_string_fetch_byte_case, re_string_destruct, re_string_context_at): (re_node_set_alloc, re_node_set_init_1, re_node_set_init_2): (re_node_set_init_copy, re_node_set_add_intersect): (re_node_set_init_union, re_node_set_merge, re_node_set_insert): (re_node_set_insert_last, re_node_set_compare, re_node_set_contains): (re_node_set_remove_at, re_dfa_add_node, calc_state_hash): (re_acquire_state, re_acquire_state_context, register_state): (create_ci_newstate, create_cd_newstate, free_state): Likewise. * lib/regexec.c (regexec, re_match, re_search, re_match_2, re_search_2): (re_search_2_stub, re_search_stub, re_copy_regs, re_set_registers): (re_search_internal, prune_impossible_nodes): (acquire_init_state_context, check_matching, static): (check_halt_node_context, check_halt_state_context, proceed_next_node): (push_fail_stack, pop_fail_stack, set_regs, free_fail_stack_return): (update_regs, sift_states_backward, build_sifted_states): (clean_state_log_if_needed, merge_state_array): (update_cur_sifted_state, add_epsilon_src_nodes): (sub_epsilon_src_nodes, check_dst_limits, check_dst_limits_calc_pos_1): (check_dst_limits_calc_pos, check_subexp_limits, sift_states_bkref): (sift_states_iter_mb, transit_state, merge_state_with_log, static): (find_recover_state, check_subexp_matching_top, transit_state_mb): (transit_state_bkref, get_subexp, get_subexp_sub, find_subexp_node): (check_arrival, check_arrival_add_next_nodes): (check_arrival_expand_ecl, check_arrival_expand_ecl_sub): (expand_bkref_cache, build_trtable, group_nodes_into_DFAstates): (check_node_accept_bytes, check_node_accept, extend_buffers): (match_ctx_init, match_ctx_clean, match_ctx_free, match_ctx_add_entry): (search_cur_bkref_entry, match_ctx_add_subtop, match_ctx_add_sublast): (sift_ctx_init): Likewise. * lib/regex_internal.h: (re_string_allocate, re_string_construct, re_string_reconstruct): (re_string_realloc_buffers, build_wcs_buffer, build_wcs_upper_buffer): (build_upper_buffer, re_string_translate_buffer, re_string_destruct): (re_string_elem_size_at, re_string_char_size_at, re_string_wchar_at): (re_string_context_at, re_string_peek_byte_case): (re_string_fetch_byte_case): Declare even if RE_NO_INTERNAL_PROTOTYPES is defined, since we now use prototypes always. * lib/regex.h (_RE_ARGS): Remove. No longer needed, since we assume C89 or better. All uses removed.
Paul Eggert 6caf406f 2005-08-18T05:08:05 Remove useless space-before-tab.
Paul Eggert 7277ed5a 2005-08-16T00:07:03 * config/srclist.txt: Comment out $LIBCSRC/posix/regex.h. Add comments for each pending glibc patch. * lib/regex.h (__restrict_arr): Don't define to __restrict if __cplusplus is defined.
Paul Eggert 151e40bb 2005-07-07T08:08:39 * modules/regex (Files): Add lib/regex_internal.c, lib/regex_internal.h, lib/regexec.c, lib/regcomp.c, m4/codeset.m4. (Depends-on): Add extensions. (Makefile.am): Remove lib_SOURCES; now done by m4 code. * config/srclist.txt: Add regcomp.c, regex.c, regex.h, regex_internal.c, regexec.c. Add regex_internal.h too, but as a comment, since the libc version is currently broken in gnulib mode. * lib/regex.c, lib/regex.h: Sync from libc. * lib/regcomp.c, lib/regexec_internal.c, lib/regex_internal.h, lib/regexec.c: New files, synced from libc, except that regex_internal.h currently has a small porting fix. * m4/regex.m4: Adjust to new libc regex implementation. (gl_INCLUDED_REGEX): Add AC_LIBSOURCES for all the .c and .h parts of (the new) regex. Quote the m4 stuff better. Check for RE_ICASE bug of old gnulib. Check for REG_STARTEND of recent libc. Rename local variables from jm_* to gl_*. Quote operand of "test -f". Say "recent enough" version of libc, not "version 2". (gl_PREREQ_REGEX): Remove AC_FUNC_ALLOCA, since alloca is a prerequisite module. Remove AC_HEADER_STDC; no longer needed. Check for locale.h, isblank, mbrtowc, wcrtomb, wcscoll. Remove check for btowc, isascii. Require AM_LANGINFO_CODESET.
Paul Eggert 6ef9a073 2005-05-15T04:45:43 Sync from coreutils. * modules/yesno (Depends-on): Add getline. * gethrxtime.c, gethrxtime.h, getpass.h, mountlist.h, path-concat.c, regex.h, strtoll.c, unlocked-io.h, xtime.h: White space changes only. * makepath.c (make_path): Port to hosts where leading "//" is special. * yesno.c: Include getline.h, not ctype.h. (yesno): Don't remove leading white space; POSIX doesn't allow it. Use getline to remove arbitrary restriction on response length.
Paul Eggert 267a39ba 2005-05-14T06:03:57 *** empty log message ***
Paul Eggert d136d930 2003-09-10T06:18:22 Remove K&R cruft.
Paul Eggert 9d738dcb 2003-08-17T05:30:20 Undo white space changes of 2003-08-12, allowing us to sync more files from glibc.
Paul Eggert a2e0479b 2003-08-12T23:27:26 White space fixes from coreutils.
Karl Berry 0438d509 2003-08-10T13:54:55 update regex.h from libc
Paul Eggert 202b2af4 2003-08-09T08:57:49 Merge from coreutils.
Karl Berry c9a65f97 2003-04-18T12:04:31 update from libc
Karl Berry b7476078 2002-11-25T00:17:33 change license to gpl.
Jim Meyering ba951bda 2001-12-15T16:57:15 (__restrict_arr): Update from libc.
Jim Meyering 28877cd2 2001-08-12T12:49:11 update from libc
Jim Meyering 3e1ee4f3 2001-04-02T08:31:28 Update from GNU libc.
Jim Meyering 4aeea603 2000-10-29T13:49:56 (__restrict_arr): Move definition out of #ifndef block. Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but doesn't define __restrict_arr.
Jim Meyering fb523b1e 2000-10-28T07:15:32 Update from libc.
Jim Meyering 34d6df51 2000-05-04T07:06:42 Update from glibc.
Jim Meyering dd82a0db 1999-01-13T05:36:45 new version from glibc
Jim Meyering 9fb5802a 1998-08-07T12:54:51 update from glibc
Jim Meyering 54dce95d 1998-03-23T07:24:54 update from libc/copies
Jim Meyering a44bdcc8 1997-07-26T02:55:14 replace with new version from libc
Jim Meyering 37f27c1b 1996-07-15T02:41:49 update FSF address in copyright and remove any trailing blanks
Jim Meyering 428f2264 1995-10-19T14:21:35 New version from FSF.
Jim Meyering b80c3874 1995-05-20T13:28:24 merge with 1.11.1a
Jim Meyering 7bf62aa2 1995-02-16T20:25:54 update from FSF
Jim Meyering 87e2683e 1992-11-08T02:50:44 Initial revision