summaryrefslogtreecommitdiff
path: root/lib/regcomp.c
Commit message (Collapse)AuthorAgeFilesLines
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* regex: work with GCC7's -Werror=implicit-fallthrough=Paul Eggert2017-07-261-4/+17
| | | | | | * lib/regex_internal.h (FALLTHROUGH): New macro. * lib/regcomp.c (peek_token_bracket, parse_expression): * lib/regexec.c (check_node_accept): Use it.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * 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'.
* regex: port to Sun CPaul Eggert2016-06-081-2/+2
| | | | | | | Reported by Daiki Ueno. * lib/regcomp.c (regcomp, regerror): Use _Restrict_, not __restrict, in prototype. This fixes a problem I introduced in the 2016-02-19 merge from glibc.
* Use GCC_LINT, not lintPaul Eggert2016-05-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD and Cygwin #define _Noreturn to empty if 'lint' is defined. Problem reported by Ken Brown in: http://bugs.gnu.org/23640 * doc/posix-headers/stdnoreturn.texi (stdnoreturn.h): Document problem with lint and _Noreturn. * lib/diffseq.h (IF_LINT, IF_LINT2): * lib/fts.c (sccsid): * lib/getndelim2.c (IF_LINT): * lib/gl_anylinked_list2.h (gl_linked_iterator) (gl_linked_iterator_from_to): * lib/gl_anytree_list2.h (gl_tree_iterator) (gl_tree_iterator_from_to): * lib/gl_anytree_oset.h (gl_tree_iterator): * lib/gl_array_list.c (gl_array_iterator) (gl_array_iterator_from_to): * lib/gl_array_oset.c (gl_array_iterator): * lib/gl_carray_list.c (gl_carray_iterator) (gl_carray_iterator_from_to): * lib/idcache.c: * lib/inet_ntop.c (IF_LINT): * lib/regcomp.c (build_charclass_op, create_tree): * lib/regex_internal.c (re_acquire_state) (re_acquire_state_context): * lib/trigl.c (rcsid): * lib/trim.c (IF_LINT): * lib/vasnprintf.c (IF_LINT): * lib/verify.h (assume): Treat GCC_LINT like lint.
* regex: make it closer to libcPaul Eggert2016-02-191-33/+32
| | | | | | | | | | | | | | | 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.
* regex: merge patches from libcPaul Eggert2016-02-191-31/+7
| | | | | | | | | | | | | 2015-10-21 Joseph Myers <joseph@codesourcery.com> 2015-10-20 Joseph Myers <joseph@codesourcery.com> Convert miscellaneous function definitions to prototype style. * lib/regcomp.c (re_compile_pattern, re_set_syntax) (re_compile_fastmap, regcomp, regerror, regfree, re_comp): * lib/regexec.c (regexec, re_match, re_search, re_match_2, re_search_2) (re_search_2_stub, re_search_stub, re_set_registers, re_exec) (re_search_internal): Convert to prototype-style function definition. Use internal_function for internal functions.
* regex: treat [x] as x if x is a unibyte encoding errorPaul Eggert2016-01-241-2/+15
| | | | | | | Problem reported by Aharon Robbins in: http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00091.html * lib/regcomp.c (parse_byte) [!_LIBC && RE_ENABLE_I18N]: New function. (build_range_exp) [!_LIBC && RE_ENABLE_I18N]: Use it.
* regex: pacify static checkersPaul Eggert2016-01-181-0/+6
| | | | | | | Problem and draft fix reported by Aharon Robbins in: http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html * lib/regcomp.c (build_charclass_op, create_tree) [lint]: Clear memory to pacify static checkers.
* regex: fix [ diagnosticPaul Eggert2016-01-181-2/+2
| | | | | | | | Problem and fix reported by Aharon Robbins in: http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html * lib/regcomp.c (REG_EBRACK_IDX): Fix misleading diagnostic about [. * lib/regcomp.c (build_range_exp, build_charclass_op)
* regex: fix memory leaksPaul Eggert2016-01-181-14/+13
| | | | | | | | Problem and draft fix reported by Aharon Robbins in: http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html * lib/regcomp.c (build_range_exp, build_charclass_op): * lib/regex_internal.c (re_dfa_add_node): Fix memory leak on failure.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * 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'.
* Diagnose ERE '()|\1'Paul Eggert2015-09-191-0/+4
| | | | | | | | | Problem reported by Hanno Böck in: http://bugs.gnu.org/21513 * lib/regcomp.c (parse_reg_exp): While parsing alternatives, keep track of the set of previously-completed subexpressions available before the first alternative, and restore this set just before parsing each subsequent alternative. This lets us diagnose the invalid back-reference in the ERE '()|\1'.
* regex: merge patches from libcPaul Eggert2015-09-191-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2015-09-08 Joseph Myers <joseph@codesourcery.com> Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912). * lib/regex_internal.h: Include <libc-lock.h> instead of <bits/libc-lock.h>. 2015-06-09 Joseph Myers <joseph@codesourcery.com> Fix regcomp wcscoll, wcscmp namespace (bug 18497). * lib/regcomp.c (build_range_exp): Call __wcscoll instead of wcscoll. * lib/regexec.c (check_node_accept_bytes): Likewise. 2015-06-05 Joseph Myers <joseph@codesourcery.com> Fix regex wcrtomb namespace (bug 18496). * lib/regex_internal.c (build_wcs_upper_buffer): Call __wcrtomb instead of wcrtomb. 2015-06-05 Joseph Myers <joseph@codesourcery.com> Fix regex wctype namespace (bug 18495). * lib/regcomp.c (re_compile_fastmap_iter): Call __towlower instead of towlower. * lib/regex_internal.c (build_wcs_upper_buffer): Call __iswlower instead of iswlower. Call __towupper instead of towupper. * lib/regex_internal.h (IS_WIDE_WORD_CHAR): Call __iswalnum instead of iswalnum. 2015-01-07 Chris Metcalf <cmetcalf@ezchip.com> * lib/regcomp.c (parse_bracket_exp): Initialize type to COLL_SYM in a couple of places to avoid uninitialized variable wanings on tilegx gcc 4.8.2. 2014-11-24 Siddhesh Poyarekar <siddhesh@redhat.com> * lib/regex_internal.h: Remove NOT_IN_libc. 2014-11-17 Andreas Schwab <schwab@suse.de> * lib/regex_internal.h: Don't include <locale/elem-hash.h>. 2014-09-11 Roland McGrath <roland@hack.frob.com> Move findidx nested functions to top-level. * lib/regcomp.c [_LIBC]: #include <locale/weight.h>. (build_equiv_class) [_LIBC]: Don't #include it inside the function. Pass new arguments to findidx. * lib/regexec.c [RE_ENABLE_I18N] [_LIBC]: #include <locale/weight.h>. [RE_ENABLE_I18N] (check_node_accept_bytes) [_LIBC]: Don't #include it inside the function. Pass new arguments to findidx. * lib/regex_internal.h: [!NOT_IN_libc] [_LIBC]: #include <locale/weight.h>. (re_string_elem_size_at): Don't #include it inside the function. Pass new arguments to findidx. 2014-08-01 Siddhesh Poyarekar <siddhesh@redhat.com> Check if DEBUG is defined in regex_internal.c * lib/regex_internal.c: Check if DEBUG is defined and is set.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* regex: don't deref NULL upon heap allocation failureJim Meyering2014-07-121-0/+2
| | | | | | | | | | | * lib/regcomp.c (parse_dup_op): Handle duplicate_tree failure in one more place. To trigger the segfault, configure grep -with-included-regex, build it, and run these commands: ( ulimit -v 300000; echo a|src/grep -E a+++++++++++++++++++++ ) I discovered this while replying to a private report from Jens Schleusener about excessive memory consumption by grep when using a regular expression like the one above.
* regex: fix memory leak in compilerPaul Eggert2014-07-111-1/+5
| | | | | | | Fix by Andreas Schwab in: https://sourceware.org/ml/libc-alpha/2014-06/msg00503.html * lib/regcomp.c (parse_reg_exp): Deallocate partially constructed tree before returning error.
* regex: fix memory leak in compilerPaul Eggert2014-06-191-3/+11
| | | | | | | Fix by Andreas Schwab in: https://sourceware.org/ml/libc-alpha/2014-06/msg00462.html * lib/regcomp.c (parse_expression): Deallocate partially constructed tree before returning error.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* c-ctype, regex, verify: port to gcc -std=c90 -pedanticPaul Eggert2013-05-291-1/+1
| | | | | | | | | | | | Avoid constructions that are rejected by gcc -std=c90 -pedantic. This fixes a porting bug I recently reintroduced in regex, and some other instances that I discovered while testing the fix. * lib/c-ctype.h [__STRICT_ANSI__]: Avoid ({ ... }). * lib/regcomp.c (utf8_sb_map) [__STRICT_ANSI__]: Avoid [0 ... N] = E. * lib/regex_internal.h [!_LIBC && GNULIB_LOCK]: Do not use a macro with an empty argument if this is a pedantic pre-C99 GCC. * lib/verify.h: Do not use _Static_assert if this is a pedantic pre-C11 GCC.
* regex: fix dfa race in multithreaded usesPaul Eggert2013-05-191-3/+8
| | | | | | | | | | | | | | | | | | | | Problem reported by Ludovic Courtès in <http://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00058.html>. * lib/regex_internal.h (lock_define, lock_init, lock_fini): New macros. All uses of __libc_lock_define, __libc_lock_init changed to use the first two of these. (__libc_lock_lock, __libc_lock_unlock): New macros, for non-glibc platforms. (struct re_dfa_t): Define the lock unconditionally. * lib/regexec.c (regexec, re_search_stub): Remove some now-incorrect '#ifdef _LIBC"s. * modules/regex (Depends-on): Add pthread, if we use the included regex. * lib/regcomp.c: Do actions that are not needed for glibc, but may be needed elsewhere. (regfree, re_compile_internal): Destroy the lock. (re_compile_internal): Check for lock-initialization failure.
* regex: rename remaining __attribute calls to __attribute__.Gary V. Vaughan2013-03-081-5/+5
| | | | | | | | | | | | | | | Commit 930b85b changed definition of __attribute, but left some uses unchanged, preventing compilation of regex module on most non-gcc environments: * lib/regcomp.c (re_set_fastmap, seek_collating_symbol_entry) (lookup_collation_sequence_value, build_range_exp) (build_collating_symbol): Set attributes with newly renamed __attribute__ decorator. * lib/regex_internal.c (re_string_peek_byte_case) (re_node_set_compare, re_node_set_contains): Likewise. * lib/regexec.c (acquire_init_state_context): Likewise. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* regex: merge patches from libcPaul Eggert2013-02-251-45/+27
| | | | | | | | | | | | | 2013-02-26 Siddhesh Poyarekar <siddhesh@redhat.com> * lib/regex_internal.h (__attribute__): Rename from __attribute. All uses changed. (bitset_not, bitset_merge, bitset_mask, re_string_char_size_at) (re_string_wchar_at, re_string_elem_size_at): Mark function as possibly unused. 2013-02-12 Andreas Schwab <schwab@suse.de> [BZ #11561] * lib/regcomp.c (parse_bracket_exp) [_LIBC]: When looking up collating elements compare against the byte sequence of it, not its name.
* regex: conform to strict CPaul Eggert2013-01-051-1/+2
| | | | | * lib/regcomp.c (parse_bracket_exp): Add cast to conform to strict C. From Aharon Robbins.
* regex: omit needless signed-pointer castsPaul Eggert2013-01-011-13/+13
| | | | | | | | | * lib/regcomp.c (build_charclass, build_charclass_op): Use char *, not unsigned char *, for class name and extra. The char values are always nonnegative so there's no need to insist on unsigned char * here, and using char * removes the need for casts. Reported by Aharon Robbins in <http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>.
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* regex: implement rational rangesPaul Eggert2012-12-301-9/+3
| | | | | | | | Reported by Aharon Robbins in <http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>. * lib/regcomp.c (build_range_exp) [!_LIBC]: * lib/regexec.c (check_node_accept_bytes) [!_LIBC]: Implement rational ranges.
* regex: port to C89Paul Eggert2012-12-301-1/+1
| | | | | | Reported by Aharon Robbins in <http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>. * lib/regcomp.c (init_word_char): Declaration before statement.
* regex: merge glibc changesPaul Eggert2012-12-301-9/+10
| | | | | | | | | 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.
* regex: use locale-independent comparison for codeset namePaul Eggert2012-06-261-2/+4
| | | | | | | | | See Bruno Haible's comment in <http://bugs.gnu.org/10305#120>. * lib/regcomp.c (init_dfa): Use just ASCII case comparison for codeset name. * lib/regex_internal.h: Do not include <strings.h>, since we no longer use strcasecmp. * modules/regex (Depends-on): Remove strcase.
* regex: avoid warning when pointers are not longPaul Eggert2012-06-171-2/+5
| | | | | | | | | * lib/regcomp.c (parse_dup_op, mark_opt_subexp): Cast between void * and uintptr_t, not long, for portability to hosts where pointers and long have different sizes. Issue noted by Daniel P. Berrange in <http://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00122.html> and fix suggested by Bruno Haible in <http://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00128.html>.
* regex: don't assume uint64_t or uint32_tPaul Eggert2012-05-261-6/+10
| | | | | | | | * lib/regcomp.c (init_word_char): Don't assume that the types uint64_t and uint32_t exist. The C standard doesn't guarantee them, and on some 32-bit compilers there is no uint64_t. Problem reported by Gianluigi Tiesi in <http://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00154.html>.
* regex: remove unnecessary type punningPaul Eggert2012-04-041-13/+13
| | | | | | | | | | | | | | 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.
* regex: pacify GCC when compiling GRUBPaul Eggert2012-03-301-1/+1
| | | | | | * lib/regcomp.c (init_dfa): Make a pointer 'const', to avoid a diagnostic. Reported by Vladimir Serbinenko in <http://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00163.html>.
* regex: diagnose too-large repeat counts in EREsPaul Eggert2012-03-161-2/+10
| | | | | | | | | | | | | | 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.
* maint: replace FSF snail-mail addresses with URLsPaul Eggert2012-02-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>.
* regex: merge glibc changesPaul Eggert2012-02-071-20/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* maint: spelling fixesPaul Eggert2012-02-051-11/+11
|
* In commentary, do not use ` to quote.Paul Eggert2012-01-051-18/+18
|
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-2/+1
| | | | Run the new "make update-copyright" rule.
* regcomp.c: make non-_LIBC implementation of build_range_exp consistentJim Meyering2010-03-201-7/+15
| | | | | | | | | | | | The _LIBC implementation of build_range_exp correctly honors the RE_NO_EMPTY_RANGES flag when checking for reversed range endpoints. However, the non-_LIBC implementation would ignore that syntax-bit flag and return REG_ERANGE unconditionally. This change makes it honor that flag. * lib/regcomp.c (build_range_exp) [!_LIBC]: Add a parameter: "syntax". Make two pointer parameters "const". Use "syntax" bits in order to honor RE_NO_EMPTY_RANGES. (parse_bracket_exp): Update caller.
* regcomp.c: avoid the sole warning from gcc's -Wtype-limitsJim Meyering2010-02-031-1/+5
| | | | | * lib/regcomp.c (TYPE_SIGNED): Define. (parse_dup_op): Use it to avoid the sole warning from -Wtype-limits.
* regcomp.c: avoid a new -Wshadow warningJim Meyering2010-02-031-5/+4
| | | | * lib/regcomp.c (create_initial_state): Do not shadow local "err".
* regcomp.c: spelling and merge-artifact from glibcJim Meyering2010-01-281-4/+3
| | | | | * lib/regcomp.c: Merge remainder of glibc's 2da42bc06566bc89785e580fa1ac89b4c9f2a63c.
* regcomp.c: sync white-space changes from glibcJim Meyering2010-01-281-46/+46
| | | | | * lib/regcomp.c: Merge to accommodate white space changes from glibc's 2da42bc06566bc89785e580fa1ac89b4c9f2a63c.
* regcomp.c: do not ignore internal return valuesJim Meyering2010-01-281-3/+9
| | | | | | * lib/regcomp.c: Do not ignore internal return values. This is from glibc's 2da42bc06566bc89785e580fa1ac89b4c9f2a63c, but without its white-space changes and spelling fixes.
* regcomp, regexec, fnmatch: avoid array bounds read errorUlrich Drepper2010-01-041-3/+7
| | | | | | | | | * lib/regcomp.c (build_equiv_class): From glibc: Use only the low 24 bits of a findidx return value as an index into the weights array. Patch by Ulrich Drepper: http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=b7d1c5fa30 * lib/regexec.c (check_node_accept_bytes): Likewise. * lib/fnmatch_loop.c (FCT): Likewise.
* regcomp: skip collseq lookup when there are no rulesUlrich Drepper2010-01-041-2/+3
| | | | | * lib/regcomp.c (lookup_collation_sequence_value): From glibc: http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a532a41df58
* regcomp: recognize ill-formed { } expressionsUlrich Drepper2010-01-041-1/+2
| | | | | * lib/regcomp.c (parse_dup_op): From glibc: http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a87cd2894cb