Bruno Haible [Sat, 25 Feb 2012 23:36:01 +0000 (00:36 +0100)]
fmodl, remainder*: Avoid wrong results due to rounding errors.
* lib/fmodl.c (fmodl): Correct the result if it is not within the
expected bounds.
* lib/remainderf.c (remainderf): Likewise.
* lib/remainder.c (remainder): Likewise.
* lib/remainderl.c (remainderl): Likewise.
Bruno Haible [Sat, 25 Feb 2012 12:13:59 +0000 (13:13 +0100)]
fabs tests: More tests.
* tests/test-fabs.c: Include <string.h>, minus-zero.h.
(zero): New variable.
(main): Add tests for signed zero.
* modules/fabs-tests (Files): Add tests/minus-zero.h.
Bruno Haible [Sat, 25 Feb 2012 12:13:10 +0000 (13:13 +0100)]
fabsf tests: More tests.
* tests/test-fabsf.c: Include <string.h>, minus-zero.h.
(zero): New variable.
(main): Add tests for signed zero.
* modules/fabsf-tests (Files): Add tests/minus-zero.h.
Bruno Haible [Sat, 25 Feb 2012 00:45:18 +0000 (01:45 +0100)]
atanl: Provide function definition on MSVC.
* m4/atanl.m4 (gl_FUNC_ATANL): Test also whether atanl can be used as a
function pointer.
* lib/math.in.h (atanl): Undefine if it does not exist as a function.
Bruno Haible [Sat, 25 Feb 2012 00:42:45 +0000 (01:42 +0100)]
acosl: Provide function definition on MSVC.
* m4/acosl.m4 (gl_FUNC_ACOSL): Test also whether acosl can be used as a
function pointer.
* lib/math.in.h (acosl): Undefine if it does not exist as a function.
Bruno Haible [Sat, 25 Feb 2012 00:39:34 +0000 (01:39 +0100)]
asinl: Provide function definition on MSVC.
* m4/asinl.m4 (gl_FUNC_ASINL): Test also whether asinl can be used as a
function pointer.
* lib/math.in.h (asinl): Undefine if it does not exist as a function.
Bruno Haible [Sat, 25 Feb 2012 00:36:41 +0000 (01:36 +0100)]
tanl: Provide function definition on MSVC.
* m4/tanl.m4 (gl_FUNC_TANL): Test also whether tanl can be used as a
function pointer.
* lib/math.in.h (tanl): Undefine if it does not exist as a function.
Bruno Haible [Sat, 25 Feb 2012 00:31:58 +0000 (01:31 +0100)]
cosl: Provide function definition on MSVC.
* m4/cosl.m4 (gl_FUNC_COSL): Test also whether cosl can be used as a
function pointer.
* lib/math.in.h (cosl): Undefine if it does not exist as a function.
Bruno Haible [Sat, 25 Feb 2012 00:30:14 +0000 (01:30 +0100)]
sinl: Provide function definition on MSVC.
* m4/sinl.m4 (gl_FUNC_SINL): Test also whether sinl can be used as a
function pointer.
* lib/math.in.h (sinl): Undefine if it does not exist as a function.
Bruno Haible [Sat, 25 Feb 2012 00:27:00 +0000 (01:27 +0100)]
logl: Provide function definition on MSVC.
* m4/logl.m4 (gl_FUNC_LOGL): Test also whether logl can be used as a
function pointer.
* lib/math.in.h (logl): Undefine if it does not exist as a function.
Bruno Haible [Sat, 25 Feb 2012 00:24:28 +0000 (01:24 +0100)]
expl: Provide function definition on MSVC.
* m4/expl.m4 (gl_FUNC_EXPL): Test also whether expl can be used as a
function pointer.
* lib/math.in.h (expl): Undefine if it does not exist as a function.
Bruno Haible [Sat, 25 Feb 2012 00:10:38 +0000 (01:10 +0100)]
sqrtl: Provide function definition on MSVC.
* m4/sqrtl.m4 (gl_FUNC_SQRTL): Test also whether sqrtl can be used as
a function pointer.
* lib/math.in.h (sqrtl): Undefine if it does not exist as a function.
Bruno Haible [Sat, 25 Feb 2012 00:17:22 +0000 (01:17 +0100)]
ceill: Provide function definition on MSVC.
* m4/ceill.m4 (gl_FUNC_CEILL_LIBS): Test also whether ceill can be
used as a function pointer.
* lib/math.in.h (ceill): Undefine if it is not declared as a function.
Bruno Haible [Sat, 25 Feb 2012 00:15:03 +0000 (01:15 +0100)]
floorl: Provide function definition on MSVC.
* m4/floorl.m4 (gl_FUNC_FLOORL_LIBS): Test also whether floorl can be
used as a function pointer.
* lib/math.in.h (floorl): Undefine if it is not declared as a function.
Bruno Haible [Sat, 25 Feb 2012 00:09:12 +0000 (01:09 +0100)]
ceilf: Provide function definition on MSVC.
* m4/ceilf.m4 (gl_FUNC_CEILF_LIBS): Test also whether ceilf can be
used as a function pointer.
* lib/math.in.h (ceilf): Undefine if it is not declared as a function.
Bruno Haible [Sat, 25 Feb 2012 00:07:19 +0000 (01:07 +0100)]
floorf: Provide function definition on MSVC.
* m4/floorf.m4 (gl_FUNC_FLOORF_LIBS): Test also whether floorf can be
used as a function pointer.
* lib/math.in.h (floorf): Undefine if it is not declared as a function.
Stanislav Brabec [Fri, 24 Feb 2012 20:24:44 +0000 (12:24 -0800)]
regex: fix false multibyte matches in some regular expressions
See <http://sourceware.org/bugzilla/show_bug.cgi?id=13637>
and <http://sourceware.org/ml/libc-alpha/2012-02/msg00521.html>.
* lib/regex_internal.c (re_string_skip_chars):
Fix miscomputation of remain_len that may cause incomplete
multi-byte character and false match.
Paul Eggert [Mon, 20 Feb 2012 00:12:06 +0000 (01:12 +0100)]
acl: Don't use GETACLCNT and similar ops, since they are unreliable.
- There were several instances of this pattern:
for (;;) {
n = acl (f, GETACLCNT, 0, NULL);
[ allocate an array A of size N ]
if (acl (f, GETACL, n, a) == n)
break;
}
This loop might never terminate if some other process is constantly
manipulating the file's ACL. The loop should be rewritten to
terminate.
- The acl (... GETACLNT ...) call is merely an optimization; its value
is merely a hint as to how big to make the array. A better
optimization is to avoid the acl (... GETACLNT ...) call entirely,
and just guess a reasonably-big size, growing the size and trying
again if it's not large enough. This guarantees termination, and
saves a system call.
* lib/acl-internal.h: Include <limits.h>.
(MIN, SIZE_MAX): New macros.
* lib/file-has-acl.c (file_has_acl) [Solaris]: Read the entries into
a stack-allocated buffer, and use malloc if it does not fit. Don't
use GETACLCNT.
* lib/set-mode-acl.c (qset_acl) [Solaris]: Likewise.
Bruno Haible [Sun, 19 Feb 2012 21:17:05 +0000 (22:17 +0100)]
acl: Fix endless loop on Solaris with vxfs.
* lib/file-has-acl.c (file_has_acl) [Solaris]: Treat a failing
acl()/facl() call for ACE_GETACL like a failing call for ACE_GETACLCNT.
* lib/set-mode-acl.c (qset_acl) [Solaris]: Likewise.
* lib/copy-acl.c (qcopy_acl)[Solaris]: Likewise.
* tests/test-sameacls.c (main)[Solaris]: Likewise.
Reported by Bill Jones in
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10639>, via Paul Eggert.
Bruno Haible [Sun, 19 Feb 2012 20:59:07 +0000 (21:59 +0100)]
acl: Fix copy-acl test failure on Solaris 11 2011-11.
* lib/file-has-acl.c (NEW_ACE_WRITEA_DATA): New macro.
(acl_ace_nontrivial): Relax the restrictions on access_masks[] so
that this function returns 0 in some more cases.
Bruno Haible [Sun, 19 Feb 2012 14:06:52 +0000 (15:06 +0100)]
Fix test failure in many locales on Solaris 11.
* tests/test-pipe-filter-gi1.c (main): Don't use range expression in
'tr' arguments.
* tests/test-pipe-filter-ii1.c (main): Likewise.
* build-aux/bootstrap (check_versions): Run 'tr' command with range
expressions in the C locale.
* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Likewise.
* m4/host-os.m4 (gl_HOST_OS): Likewise.
GNUmakefile: simplify detection of unconfigured trees
* top/GNUmakefile: Use $(wildcard) instead of $(shell) to determine
whether the tree make is being run from is already configured or
not. Related simplifications.
Paul Eggert [Wed, 8 Feb 2012 06:47:01 +0000 (22:47 -0800)]
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.
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-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.
2010-05-05 Andreas Schwab <schwab@redhat.com>
* lib/regexec.c (find_collation_sequence_value):
Fix lookup of collation sequence value during regexp matching.
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.