Commit Graph

65 Commits

Author SHA1 Message Date
Paul Eggert 581c785bf3 Update copyright dates with scripts/update-copyrights
I used these shell commands:

../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright
(cd ../glibc && git commit -am"[this commit message]")

and then ignored the output, which consisted lines saying "FOO: warning:
copyright statement not found" for each of 7061 files FOO.

I then removed trailing white space from math/tgmath.h,
support/tst-support-open-dev-null-range.c, and
sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following
obscure pre-commit check failure diagnostics from Savannah.  I don't
know why I run into these diagnostics whereas others evidently do not.

remote: *** 912-#endif
remote: *** 913:
remote: *** 914-
remote: *** error: lines with trailing whitespace found
...
remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
2022-01-01 11:40:24 -08:00
Paul Eggert 0b5ca7c3e5 regex: copy back from Gnulib
Copy regex-related files back from Gnulib, to fix a problem with
static checking of regex calls noted by Martin Sebor.  This merges the
following changes:

* New macro __attribute_nonnull__ in misc/sys/cdefs.h, for use later
when copying other files back from Gnulib.

* Use __GNULIB_CDEFS instead of __GLIBC__ when deciding
whether to include bits/wordsize.h etc.

* Avoid duplicate entries in epsilon closure table.

* New regex.h macro _REGEX_NELTS to let regexec say that its pmatch
arg should contain nmatch elts.  Use that for regexec, instead of
__attr_access (which is incorrect).

* New regex.h macro _Attr_access_ which is like __attr_access except
portable to non-glibc platforms.

* Add some DEBUG_ASSERTs to pacify gcc -fanalyzer and to catch
recently-fixed performance bugs if they recur.

* Add Gnulib-specific stuff to port the dynarray- and lock-using parts
of regex code to non-glibc platforms.

* Fix glibc bug 11053.

* Avoid some undefined behavior when popping an empty fail stack.
2021-09-21 08:00:44 -07:00
Martin Sebor 26492c0a14 Annotate additional APIs with GCC attribute access.
This change continues the improvements to compile-time out of bounds
checking by decorating more APIs with either attribute access, or by
explicitly providing the array bound in APIs such as tmpnam() that
expect arrays of some minimum size as arguments.  (The latter feature
is new in GCC 11.)

The only effects of the attribute and/or the array bound is to check
and diagnose calls to the functions that fail to provide a sufficient
number of elements, and the definitions of the functions that access
elements outside the specified bounds.  (There is no interplay with
_FORTIFY_SOURCE here yet.)

Tested with GCC 7 through 11 on x86_64-linux.
2021-05-06 11:01:05 -06:00
Adhemerval Zanella c2a150d089 posix: Sync regex code with gnulib
It sync with gnulib commit 43ee1a6bf.  The main change is 9682f18e9.
(which does not have a meaniful description).

Checked on x86_64-linux-gnu.
2021-01-04 08:38:52 -03:00
Paul Eggert 2b778ceb40 Update copyright dates with scripts/update-copyrights
I used these shell commands:

../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright
(cd ../glibc && git commit -am"[this commit message]")

and then ignored the output, which consisted lines saying "FOO: warning:
copyright statement not found" for each of 6694 files FOO.
I then removed trailing white space from benchtests/bench-pthread-locks.c
and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this
diagnostic from Savannah:
remote: *** pre-commit check failed ...
remote: *** error: lines with trailing whitespace found
remote: error: hook declined to update refs/heads/master
2021-01-02 12:17:34 -08:00
Paul Eggert 6aa1160d16 Sync regex.h from Gnulib
* posix/regex.h: Remove an ‘#ifndef _CRAY’ that hasn’t been needed
for years in Gnulib (and was needed only because of Gnulib).
2020-08-04 23:24:03 -07:00
Joseph Myers d614a75396 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
Joseph Myers 04277e02d7 Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2019-01-01 00:11:28 +00:00
Adhemerval Zanella eb04c21373 posix: Sync gnulib regex implementation
This patch syncs the regex implementation with gnulib (commit 0ee5212).
Only two changes in GLIBC regex testing are required:

  1. posix/bug-regex28.c: as previously discussed [1] the change of
     expected results on the pattern should be safe.

  2. posix/PCRE.tests: the ERE (a)|\1 is malformed (in the sense that
     the \1 doesn't mean anything) and although current GLIBC accepts
     it has undefined behavior.  This patch removes the specific test.

This sync contains some patches from thread 'Regex: Make libc regex
more usable outside GLIBC.' [2] which have been pushed upstream in
gnulib.  This patches also fixes some regex issues (BZ #23233,
BZ #21163, BZ #18986, BZ #13762) and I did not add testcases for
both #23233 and #13762 because I couldn't think a simple way to
trigger the expected failure path to trigger them.

Checked on x86_64-linux-gnu and i686-linux-gnu.

	[BZ #23233]
	[BZ #21163]
	[BZ #18986]
	[BZ #13762]
	* posix/Makefile (tests): Add bug-regex37 and bug-regex38.
	* posix/PCRE.tests: Remove invalid test.
	* posix/bug-regex28.c: Fix expected values for used syntax.
	* posix/bug-regex37.c: New file.
	* posix/bug-regex38.c: Likewise.
	* posix/regcomp.c: Sync with gnulib.
	* posix/regex.c: Likewise.
	* posix/regex.h: Likewise.
	* posix/regex_internal.c: Likewise.
	* posix/regex_internal.h: Likewise.
	* posix/regexec.c: Likewise.

[1] https://sourceware.org/ml/libc-alpha/2017-12/msg00807.html
[2] https://sourceware.org/ml/libc-alpha/2017-12/msg00237.html
2018-07-04 09:54:45 -03:00
Joseph Myers 688903eb3e Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2018-01-01 00:32:25 +00:00
Arnold Robbins 5069ff3284 regex: Fix spelling in comments.
Fix the spelling in various comments throughout the
regex implementation. These changes are also present
in gnulib and will be integrated there also, see:
https://sourceware.org/ml/libc-alpha/2017-12/msg00688.html
2017-12-19 19:28:21 -08:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Joseph Myers 498afc54df Combine __USE_BSD and __USE_SVID into __USE_MISC.
This patch cleans up following the obsoletion of _BSD_SOURCE and
_SVID_SOURCE by combining __USE_BSD and __USE_SVID into __USE_MISC.

The only non-mechanical part of this patch is the changes to
features.h; everything else is simple substitution of __USE_MISC for
the old macros.  Thus, this patch leaves obviously redundant
conditionals such as "defined __USE_MISC || defined __USE_MISC", and
does not update #endif comments where they referred to BSD or SVID in
words instead of the literal macro name.  This is intended to
facilitate patch review by separating the less mechanical changes from
these purely mechanical changes into a separate patch.  (I do intend
to integrate all the changes from
<https://sourceware.org/ml/libc-alpha/2013-12/msg00226.html>, which I
believe includes all the trailing comment updates, in subsequent
patches.)

Tested x86_64.

	* include/features.h (__USE_BSD): Remove macro definitions.
	(__USE_SVID): Likewise.
	(_BSD_SOURCE): Likewise.
	(_SVID_SOURCE): Likewise.
	[!defined _BSD_SOURCE && !defined _SVID_SOURCE]: Remove condition
	from definition of _DEFAULT_SOURCE.
	[_BSD_SOURCE || _SVID_SOURCE]: Change condition to
	[_DEFAULT_SOURCE].
	* bits/fcntl.h [__USE_BSD]: Change condition to [__USE_MISC].
	* bits/mman.h [__USE_BSD]: Likewise.
	* bits/termios.h [__USE_BSD]: Likewise.
	* bits/waitstatus.h [__USE_BSD]: Likewise.
	* ctype/ctype.h [__USE_SVID]: Likewise.
	* dirent/dirent.h [__USE_BSD]: Likewise.
	* grp/grp.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* inet/netinet/igmp.h [__USE_BSD]: Likewise.
	* io/fcntl.h [__USE_BSD]: Likewise.
	* io/ftw.h [__USE_BSD]: Likewise.
	* io/sys/stat.h [__USE_BSD]: Likewise.
	* libio/bits/stdio-ldbl.h [__USE_BSD]: Likewise.
	* libio/bits/stdio2.h [__USE_BSD]: Likewise.
	* libio/stdio.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* math/math.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* misc/bits/syslog-ldbl.h [__USE_BSD]: Likewise.
	* misc/bits/syslog.h [__USE_BSD]: Likewise.
	* misc/search.h [__USE_SVID]: Likewise.
	* misc/sys/mman.h [__USE_BSD]: Likewise.
	* misc/sys/syslog.h [__USE_BSD]: Likewise.
	* misc/sys/uio.h [__USE_BSD]: Likewise.
	* posix/bits/unistd.h [__USE_BSD]: Likewise.
	* posix/glob.h [__USE_BSD]: Likewise.
	* posix/regex.h [__USE_BSD]: Likewise.
	* posix/sys/types.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* posix/sys/utsname.h [__USE_SVID]: Likewise.
	* posix/sys/wait.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* posix/unistd.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* pwd/pwd.h [__USE_SVID]: Likewise.
	* resolv/netdb.h [__USE_BSD]: Likewise.
	* setjmp/setjmp.h [__USE_BSD]: Likewise.
	* signal/signal.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* socket/sys/socket.h [__USE_BSD]: Likewise.
	* stdlib/fmtmsg.h [__USE_SVID]: Likewise.
	* stdlib/stdlib.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* string/bits/string2.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.
	* string/bits/string3.h [__USE_BSD]: Likewise.
	* string/endian.h [__USE_BSD]: Likewise.
	* string/string.h [__USE_SVID]: Likewise.
	[__USE_BSD]: Likewise.
	* string/strings.h [__USE_BSD]: Likewise.
	* sysdeps/generic/netinet/ip.h [__USE_BSD]: Likewise.
	* sysdeps/gnu/netinet/ip_icmp.h [__USE_BSD]: Likewise.
	* sysdeps/mach/hurd/bits/fcntl.h [__USE_BSD]: Likewise.
	* sysdeps/mach/hurd/bits/stat.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/bits/sys_errlist.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/bits/termios.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_ether.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_fddi.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_tr.h [__USE_BSD]: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_BSD]:
	Likewise.
	* sysdeps/x86/bits/string.h [__USE_BSD]: Likewise.
	* sysvipc/sys/ipc.h [__USE_SVID]: Likewise.
	* termios/termios.h [__USE_BSD]: Likewise.
	* time/sys/time.h [__USE_BSD]: Likewise.
	* time/time.h [__USE_BSD]: Likewise.
	[__USE_SVID]: Likewise.

	* sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_BSD]: Change
	condition to [__USE_MISC].
2014-02-12 23:41:01 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Joseph Myers f4cf5f2d8b Add script to update copyright notices and reformat some to facilitate its use. 2013-01-01 16:29:10 +00:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Reuben Thomas 78e64fdcaa Update documentation in regex.h 2011-05-20 09:14:03 -04:00
Aharon Robbins a4b89fd846 Update RE_SYNTAX*_AWK constants in regex.h 2011-05-16 10:28:44 -04:00
Ulrich Drepper a53d3f8295 [BZ #5607]
2008-01-16  Ulrich Drepper  <drepper@redhat.com>
	[BZ #5607]
	* conform/data/fcntl.h-data: Fix posix_fadvise and posix_fallocate
	prototypes.
	* conform/data/limits.h-data: Adjust limits changed in v6 and add
	additional suffixes.
	* conform/data/mqueue.h-data: Fix typo in mq_curmsgs entry.
	Add optional functions mq_timedreceive and mq_timedsend.
	* conform/data/netdb.h-data: Add more AI_* and EAI_* constants.
	* conform/data/pthread.h-data: Fix prototype of
	pthread_condattr_setclock.  pthread_sigmask is not required in v6.
	* conform/data/semaphore.h-data: Allow time.h definitions.
	* conform/data/signal.h-data: Likewise.
	* conform/data/stdio.h-data: getw and putw are not required in v6.
	* conform/data/stdlib.h-data: Change setstate prototype.
	* conform/data/string.h-data: Fix strerror_r prototype.
	* conform/data/time.h-data: Fix typo in TIMER_ABSTIME definition.
	* conform/data/unistd.h-data: pthread_atfork not required in v6.
	Fix readlink prototype.
	* conform/data/netinet/in.h-data: Add const to in6addr_any and
	in6addr_loopback.
	* inet/netinet/in.h: Cleanup namespace.
	* posix/regex.h: Likewise.
	* resolv/netdb.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/in.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/socket.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Likewise.
2008-01-16 10:11:18 +00:00
Ulrich Drepper 6701afc727 * posix/unistd.h: Declare fsync also for __USE_XOPEN2K. 2007-11-26 22:53:40 +00:00
Ulrich Drepper 79fb2e026b Define REG_ENOSYS also for Unix98.
* posix/regex.h (REG_ENOSYS): Likewise.
2007-11-26 13:07:53 +00:00
Ulrich Drepper 5631e740ff [BZ #1201]
* posix/regex.h: g++ still cannot handled [restrict].
2006-05-02 21:55:00 +00:00
Ulrich Drepper 41a3975907 [BZ #2534, BZ #2535]
* posix/regex.h: Remove obsolete <sys/types.h> and special
	handling for VMS.
2006-04-21 18:24:53 +00:00
Ulrich Drepper 2ff89ea46f * posix/regex.h: Pretty printing.
Clean up namespace a bit.
2005-09-30 16:07:32 +00:00
Ulrich Drepper 997470b3e1 [BZ #281]
* posix/regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
	* posix/regcomp.c: Remove unnecessary uses of
	unsigned RE_TRANSLATE_TYPE.
	* posix/regex_internal.h: Likewise.
	* posix/regex_internal.c: Likewise.
	* posix/regexexec.c: Likewise.
	Based on a patch by Stepan Kasal <kasal@ucw.cz>.
2005-09-23 06:11:29 +00:00
Ulrich Drepper 2d87db5b53 * posix/regex_internal.h (re_sub_match_top_t): Remove unused member
next_last_offset.
	(struct re_dfa_t): Remove unused member states_alloc.
	* posix/regcomp.c (init_dfa): Don't initialize unused members.

2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>

	* posix/regexec.c (set_regs): Don't alloca with an unbounded size.

	alloca modernization/simplification for regex.
	* posix/regex.c: Remove portability cruft for alloca.  This no longer
	needs to be at the start of the file, and can be moved into
	regex_internal.h and simplified.
	* posix/regex_internal.h: Include <alloca.h>.
	(__libc_use_alloca) [!defined _LIBC]: New macro.
	* posix/regexec.c (build_trtable): Remove "#ifdef _LIBC",
	since the code now works outside glibc.

2005-09-06  Ulrich Drepper  <drepper@redhat.com>

	* include/regex.h: Remove use of _RE_ARGS.

2005-08-25  Paul Eggert  <eggert@cs.ucla.edu>

	* posix/regexec.c (find_recover_state): Change "err" to "*err".

2005-08-24  Paul Eggert  <eggert@cs.ucla.edu>

	* posix/regcomp.c (regerror): Pointer args are 'restrict',
	as per POSIX.
	* posix/regex.h (regerror): Likewise.
	* manual/pattern.texi (POSIX Regexp Compilation): Likewise.
	Similarly for regcomp and regexec.  Also, first 2 args of regexec
	and 2nd arg of regerror are const.

	* posix/regex.c: Do not include <sys/types.h>, as POSIX no longer
	requires this.  (The code never needed it.)

2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>

	* posix/regexec.c (sift_states_bkref): re_node_set_insert returns
	int, not reg_errcode_t.

	* posix/regex_internal.c (calc_state_hash): Put 'inline' before type,
	since some broken compilers warn about it otherwise.

	* posix/regcomp.c (create_initial_state): Remove duplicate decl.

2005-08-20  Paul Eggert  <eggert@cs.ucla.edu>

	* posix/regex.h (_RE_ARGS): Remove.  No longer needed, since we assume
	C89 or better.  All uses removed.

2005-09-06  Ulrich Drepper  <drepper@redhat.com>

	* posix/regex.c: Prevent using C++ compilers.

2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>

	* posix/regcomp.c (duplicate_node): Return new index, not an error
	code, and let the caller return REG_ESPACE if out of space.  This
	removes an uninitialied-variable warning with GCC 4.0.1, and also
	avoids taking the address of a local variable.  All callers
	changed.

2005-09-06  Ulrich Drepper  <drepper@redhat.com>

	* include/time.h (__strptime_internal): Rename parameter to avoid
	bogus compiler warning.

2005-08-19  Jim Meyering  <jim@meyering.net>

	* posix/regexec.c (proceed_next_node): Redo local variables to
	avoid GCC shadowing warnings.

2005-09-06  Ulrich Drepper  <drepper@redhat.com>

	* posix/regex_internal.c (re_acquire_state): Minor code rearrangement.
	(re_acquire_state_context): Likewise.

2005-08-19  Paul Eggert  <eggert@cs.ucla.edu>

	* posix/regex_internal.c (re_string_realloc_buffers):
	(re_node_set_insert, re_node_set_insert_last, re_dfa_add_node):
	Rename local variables to avoid GCC shadowing warnings.

2005-07-08  Eric Blake  <ebb9@byu.net>
            Paul Eggert  <eggert@cs.ucla.edu>

	* posix/regcomp.c (init_dfa): Store __btowc value in wint_t, not
	wchar_t.  Remove now-unnecessary cast.
	(build_range_exp): Likewise.
2005-09-06 21:15:13 +00:00
Roland McGrath 92d892a899 [BZ #1207]
2005-08-17  Paul Eggert  <eggert@cs.ucla.edu>
	[BZ #1207]
	* posix/regex.h: Remove spurious space-before-tab.  From gnulib.
2005-08-18 06:42:25 +00:00
Ulrich Drepper a334319f65 (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. 2004-12-22 20:10:10 +00:00
Jakub Jelinek 0ecb606cb6 2.5-18.1 2007-07-12 18:26:36 +00:00
Ulrich Drepper c06a6956a4 [BZ #544]
Update.
2004-11-18  Jakub Jelinek  <jakub@redhat.com>

	[BZ #544]
	* posix/regex.h (RE_NO_SUB): New define.
	* posix/regex_internal.h (OP_DELETED_SUBEXP): New.
	(re_dfa_t): Add subexp_map.
	* posix/regcomp.c (struct subexp_optimize): New type.
	(optimize_subexps): New routine.
	(re_compile_internal): Call it.
	(re_compile_pattern): Set preg->no_sub to 1 if RE_NO_SUB.
	(free_dfa_content): Free subexp_map.
	(calc_inveclosure, calc_eclosure): Skip OP_DELETED_SUBEXP
	nodes.
	* posix/regexec.c (re_search_internal): If subexp_map
	is not NULL, duplicate registers as needed.
	* posix/Makefile: Add rules to build and run tst-regex2.
	* posix/tst-regex2.c: New test.
	* posix/rxspencer/tests: Fix last two tests (\0 -> \1).
	Add some new tests for nested subexpressions.
2004-11-18 23:57:34 +00:00
Ulrich Drepper 6fefb4e0b1 Update.
2004-01-15  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regex.h (REG_STARTEND): Define.
	* posix/regexec.c (regexec): Check for REG_STARTEND.
2004-03-04 23:37:01 +00:00
Ulrich Drepper df759c2a21 Update.
2004-01-28  Paolo Bonzini  <bonzini@gnu.org>

	Merge regex changes in gawk.
	* posix/regcomp.c (build_range_exp) [!_LIBC]: Check validity
	of collation elements.
	* posix/regex.c: Include limits.h.
	* posix/regex.h: Document REG_ECOLLATE correctly.
	* posix/regex_internal.h [!_LIBC && !ENABLE_NLS]: Disable NLS.
2004-01-30 05:22:32 +00:00
Ulrich Drepper 06e8303a28 Update.
* posix/regcomp.c (parse_expression): If token is OP_OPEN_DUP_NUM
	and RE_CONTEXT_INVALID_DUP syntax flag is set, fail.
	* posix/regex.h (RE_CONTEXT_INVALUD_OPS): New macro.
	(RE_SYNTAX_POSIX_BASIC): Use RE_CONTEXT_INVALUD_OPS.

	* posix/regcomp.c (parse_sub_exp): In case of not-matching ( )
	return REG_EPAREN.
2003-11-13 06:01:46 +00:00
Ulrich Drepper 134abcb5b9 Update.
2003-09-26  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regcomp.c (parse_sub_exp): Pass RE_CARET_ANCHORS_HERE
	for the first token in a subexpression as well.

2003-10-02  Jakub Jelinek  <jakub@redhat.com>

	* posix/regcomp.c (peek_token): Add 2003-09-20 changes for anchor
	handling again.
	(parse_reg_exp): Likewise.
	* posix/regex.h (RE_CARET_ANCHORS_HERE): Define.

	* posix/bug-regex11.c (tests): Add new tests.
	* posix/bug-regex12.c (tests): Add new test.
2003-10-02 22:41:11 +00:00
Ulrich Drepper a0788ec48c Update.
* posix/regcomp.c (peek_token): Remove recent changes for anchor
	handling again.
	(parse_reg_exp): Likewise.
	* posix/regex.h: Remove RE_CARET_ANCHORS_HERE.

	(peek_token): Accept \s and \S as OP_SPACE and OP_NOTSPACE.
	(parse_expression): Replace build_word_op with
2003-09-25 20:48:59 +00:00
Ulrich Drepper ce85933261 Upate.
2003-09-20  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regcomp.c (peek_token): Don't look back for ( or |
	to check whether to treat a caret as special.  It fails
	for the (extended) regex \(^.
	(parse, parse_reg_exp): Pass RE_CARET_ANCHORS_HERE to fetch_token.
	* posix/regex.h: Define RE_CARET_ANCHORS_HERE.

	* posix/regexec.c: Check out of bounds value before shifting.

	* posix/regex_internal.h: Define __attribute for non-gcc.
2003-09-23 05:33:43 +00:00
Ulrich Drepper 94c24227fc Update.
2003-04-16  Jakub Jelinek  <jakub@redhat.com>

	* elf/Makefile (distribute): Add tst-tlsmod{[7-9],1[0-2]}.c and
	tst-tls10.h.
	(tests): Add tst-tls1[0-2].
	(modules-names): Add tst-tlsmod{[7-8],1[0-2]}.
	($(objpfx)tst-tlsmod8.so): Depend on tst-tlsmod7.so.
	($(objpfx)tst-tlsmod10.so): Depend on tst-tlsmod9.so.
	($(objpfx)tst-tlsmod12.so): Depend on tst-tlsmod11.so.
	($(objpfx)tst-tls10): Depend on tst-tlsmod8.so.
	($(objpfx)tst-tls11): Depend on tst-tlsmod10.so.
	($(objpfx)tst-tls12): Depend on tst-tlsmod12.so.
	* elf/tst-tls10.c: New test.
	* elf/tst-tls11.c: New test.
	* elf/tst-tls12.c: New test.
	* elf/tst-tls10.h: New file.
	* elf/tst-tlsmod7.c: New file.
	* elf/tst-tlsmod8.c: New file.
	* elf/tst-tlsmod9.c: New file.
	* elf/tst-tlsmod10.c: New file.
	* elf/tst-tlsmod11.c: New file.
	* elf/tst-tlsmod12.c: New file.

2003-04-15  Steven Munroe  <sjmunroe@us.ibm.com>

	* sysdeps/powerpc/bits/atomic.h: Moved ppc32/64 specific code to ...
	* sysdeps/powerpc/powerpc32/bits/atomic.h: New file.
	* sysdeps/powerpc/powerpc64/bits/atomic.h: New file.

	* posix/regex.h: Include <sys/types.h>.
2003-04-17 19:19:29 +00:00
Ulrich Drepper c0a0f9a32c Update.
2002-05-21  Isamu Hasegawa  <isamu@yamato.ibm.com>

	* posix/regex.c: Define `inline' as a macro into nothing for the
	compilers which lack the keyword.
	* posix/regex.h: (RE_SYNTAX_GNU_AWK): Remove RE_CONTEXT_INVALID_OPS
	for the compatibility of gawk.
	* posix/regcomp.c: Add fake implementation of isblank() for the
	environments which lack the function.
	Don't use free_charset() in case of non-i18n envs.
	(build_range_exp): Don't use i18n related code in case of non-i18n
	envs.
	(build_collating_symbol): Likewise.
	(build_equiv_class): Likewise.
	(build_charclass): Likewise.
	(re_compile_fastmap_iter): Likewise.
	(parse_bracket_exp): Likewise.
	(build_word_op): Likewise.
	(regfree): Don't use free_charset() in case of non-i18n envs.
	* posix/regex_internal.h: Remove COMPLEX_BRACKET from
	re_token_type_t in case of non-i18n envs.
	Don't define re_charset_t in case of non-i18n envs.
	Change the type of wcs of re_string_t from wchar_t to wint_t,
	since we store also WEOF.
	* posix/regex_internal.c: (re_string_realloc_buffers): Change
	the type of wcs of re_string_t from wchar_t to wint_t.
	(re_string_reconstruct): Likewise.
	(create_ci_newstate): Don't use i18n related code in case of
	non-i18n envs.
	(create_cd_newstate): Likewise.

2002-05-24  Ulrich Drepper  <drepper@redhat.com>

	* iconv/loop.c: Fix typo.

2002-05-23  Jakub Jelinek  <jakub@redhat.com>

	* inet/ether_line.c (ether_line): Fix a typo causing only
	lower 4 bits of each ethernet address byte being assigned.
	Don't modify what line points to.
	* inet/tst-ether_aton.c (main): Add ether_line tests.

2002-05-23  Marcus Brinkmann  <marcus@gnu.org>

	* manual/filesys.texi: Don't make readlink example leak memory
	when readlink fails.
2002-05-24 08:49:00 +00:00
Ulrich Drepper 3b0bdc7235 Update.
* posix/Makefile (distribute): Add regcomp.c, regexec.c,
	regex_internal.c, and regex_internal.h.
	(CFLAGS-regex.c): Replace -DMBS_SUPPORT with -DRE_ENABLE_I18N.
	* posix/regex.c: Complete rewrite.
	* posix/regexec.c: New file.
	* posix/regcomp.c: New file.
	* posix/regex_internal.c: New file.
	* posix/regex_internal.h: New file.
	* posix/regex.h (RE_ICASE): New macro.
	Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
2002-02-26 19:06:03 +00:00
Ulrich Drepper 8343eaee4a Update.
2001-11-29  Ulrich Drepper  <drepper@redhat.com>

	* posix/regex.h: Define __restrict_arr correctly.
2001-11-29 08:51:52 +00:00
Andreas Jaeger 41bdb6e20c Update to LGPL v2.1.
2001-07-06  Paul Eggert  <eggert@twinsun.com>

	* manual/argp.texi: Remove ignored LGPL copyright notice; it's
	not appropriate for documentation anyway.
	* manual/libc-texinfo.sh: "Library General Public License" ->
	"Lesser General Public License".

2001-07-06  Andreas Jaeger  <aj@suse.de>

	* All files under GPL/LGPL version 2: Place under LGPL version
	2.1.
2001-07-06 04:58:11 +00:00
Ulrich Drepper 0a45b76c62 Update.
2001-03-23  Jes Sorensen  <jes@linuxcare.com>

	* sysdeps/unix/sysv/linux/ia64/sysdep.h (ENTRY): Moved to ...
	* sysdeps/ia64/sysdep.h: ...here.

	* sysdeps/ia64/sysdep.h (LOCAL_ENTRY): Define.
	* sysdeps/ia64/sysdep.h (LOCAL_LEAF): Define.

	* sysdeps/ia64/_mcount.S (_mcount_ret_helper): Use LOCAL_LEAF() to
	declare instead of LEAF().  Suggestion from David Mosberger.

2001-03-21  David Mosberger  <davidm@hpl.hp.com>

	* sysdeps/unix/sysv/linux/ia64/sysdep.h (CALL_MCOUNT): Add unwind
	directives.
	(PSEUDO): Drop .psr and .lsb directives.

	* sysdeps/unix/sysv/linux/ia64/setjmp.S: Ditto.  Add unwind
	directives.
	* sysdeps/unix/sysv/linux/ia64/sysdep.S: Ditto.

	* sysdeps/ia64/elf/start.S: Misc cleanup: remove .psr and .lsb
	directives etc.
	* sysdeps/unix/sysv/linux/ia64/brk.S: Ditto.
	* sysdeps/unix/sysv/linux/ia64/__longjmp.S: Ditto.
	* sysdeps/ia64/_mcount.S: Remove .psr and .lsb directives (no
	longer needed).  Add unwind directives.

	* sysdeps/ia64/sysdep.h: Define ASM_UNW_PRLG_RP, ASM_UNW_PRLG_PFS,
	ASM_UNW_PRLG_PSP, ASM_UNW_PRLG_PR, and ASM_UNW_PRLG_GRSAVE.

2001-03-21  Paul Eggert  <eggert@twinsun.com>

	* posix/regex.h (RE_INVALID_INTERVAL_ORD): New macro.
	(RE_SYNTAX_POSIX_EGREP): Use it.
	* posix/regex.c (regex_compile): Implement it.

2001-03-21  Paul Eggert  <eggert@twinsun.com>

	* posix/regex.c (GET_UNSIGNED_NUMBER): Check for overflow.
	Rewrite to avoid duplicate code.

2001-03-21  H.J. Lu  <hjl@gnu.org>

	* elf/Makefile (tests): Don't depend on $(objpfx)tst-pathopt.out
	for cross-compiling.
	($(objpfx)tst-pathopt.out): Undo the last change.
2001-03-25 05:15:51 +00:00
Ulrich Drepper da2a3ca6e2 Update.
2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>

	* posix/regex.h (__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.

	* manual/search.texi: Correct description if VISIT values.
	Patch by Ben Collins <bcollins@debian.org>.
2000-10-30 04:18:33 +00:00
Ulrich Drepper 7ca404adab Update.
* stdlib/random_r.c (__setstate_r): Correct offset when computing
	new rptr and fptr.  Reported by Michael Fischer <fischer@cs.yale.edu>.

	* posix/regex.h: Add macro definitions to allow compiling outside
	glibc.
2000-08-21 23:31:38 +00:00
Ulrich Drepper 98cbe360d9 Update.
* misc/sys/cdefs.h: Define __restrict_arr.
	* include/sys/time.h: Add restrict where required by AGd4.
	* inet/arpa/inet.h: Likewise.
	* io/sys/stat.h: Likewise.
	* io/sys/statvfs.h: Likewise.
	* misc/search.h: Likewise.
	* misc/sys/select.h: Likewise.
	* posix/glob.h: Likewise.
	* posix/regex.h: Likewise.
	* posix/spawn.h: Likewise.
	* posix/unistd.h: Likewise.
	* rt/aio.h: Likewise.
	* signal/signal.h: Likewise.
	* socket/sys/socket.h: Likewise.
	* stdlib/ucontext.h: Likewise.
	* streams/stropts.h: Likewise.
	* string/string.h: Likewise.
	* time/time.h: Likewise.
	* time/sys/time.h: Likewise.

	* posix/spawn.h: Add declarations for posix_spawnattr_getscheparam
	and posix_spawnattr_setscheparam.

	* libio/stdio.h: Make cuserid prototype again available for all
	XPG versions.
2000-08-21 06:49:52 +00:00
Ulrich Drepper 0e179ea6dd Update.
* stdlib/strfmon.c: Don't report an error if final NUL is at the
	end of the buffer.  Set errno correctly if floating-point number
	would overflow buffer.

	* posix/regex.h: Update comment of
	RE_SYNTAX_POSIX_MINIMAL_EXTENDED.
2000-01-20 02:01:32 +00:00
Ulrich Drepper 9281f45d10 Update.
2000-01-18  Ulrich Drepper  <drepper@cygnus.com>

	* posix/regex.h (RE_SYNTAX_POSIX_EXTENDED): Add RE_CONTEXT_INVALID_OPS.
	* posix/regex.c (regex_compile): Return appropriate errors for
	unterminated brace expressions.  Detect invalid characters
	in brace expressions.
	* posix/bits/posix2_lim.h: Define RE_DUP_MAX correctly.
	* sysdeps/posix/sysconf.c: Include regex.h.
	Reported by Geoff Clare <gwc@unisoft.com> (PR libc/1522).
2000-01-18 09:34:50 +00:00