Paul Eggert [Mon, 24 Apr 2006 07:35:24 +0000 (07:35 +0000)]
* fsusage.m4 (gl_FILE_SYSTEM_USAGE): Use return, not exit.
Don't assume that exit status -1 is valid.
* nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise.
* putenv.m4 (gl_FUNC_PUTENV): Likewise.
* rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Likewise.
* readdir.m4 (GL_FUNC_READDIR): Include <stdlib.h>.
* rename.m4 (vb_FUNC_RENAME): Likewise.
* unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Use AC_RUN_IFELSE,
not AC_TRY_RUN. Use return, not exit. Don't assume that
functions can be used without declaring them, or that you can
exit with status -1.
* utimes-null.m4 (gl_FUNC_UTIMES_NULL): Likewise.
Paul Eggert [Thu, 20 Apr 2006 22:28:33 +0000 (22:28 +0000)]
* argp.m4 (gl_ARGP): Don't call AC_CHECK_DECLS_ONCE with more than
one argument, so that the code will be portable to Autoconf 2.60.
* getlogin_r.m4 (gl_PREREQ_GETLOGIN_R): Likewise.
* getpass.m4 (gl_PREREQ_GETPASS): Likewise.
* unlocked-io.m4 (gl_FUNC_GLIBC_UNLOCKED_IO): Likewise.
* m4/full-header-path.m4 (gl_FULL_HEADER_PATH): Use </full/path.h> rather
than "/full/path.h". Update comment to match. Shorten & generalize
m4_translit call via AS_TR_CPP.
Paul Eggert [Thu, 13 Apr 2006 22:14:12 +0000 (22:14 +0000)]
* 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 [Mon, 10 Apr 2006 06:43:33 +0000 (06:43 +0000)]
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.
Paul Eggert [Sat, 25 Mar 2006 09:48:47 +0000 (09:48 +0000)]
* regex.m4 (gl_REGEX): Fix a longstanding typo in the
implementation of Spencer ERE test #75 from grep 2.3.
Also, change sense of cached
variable, so that the message makes sense.
Paul Eggert [Sat, 25 Mar 2006 09:09:59 +0000 (09:09 +0000)]
* regex.m4 (gl_REGEX): Don't insist on REG_SYNTAX_POSIX_EGREP,
REG_SYNTAX_EMACS, and REG_IGNORE_CASE. Settle for the traditional
glibc names. Even if glibc is changed to conform to POSIX, the
traditional names will be available anyway, since regex depends on
the extensions module. Problem reported by Emanuele Giaquinta.
Paul Eggert [Fri, 17 Mar 2006 07:26:42 +0000 (07:26 +0000)]
* 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 [Sun, 12 Mar 2006 07:58:12 +0000 (07:58 +0000)]
* time_r.h (asctime_r, ctime_r): Remove. These functions can
overrun buffers and shouldn't be used (much as gets shouldn't be
used).
* time_r.c (asctime_r, ctime_r): Likewise.
Simon Josefsson [Tue, 7 Mar 2006 13:20:11 +0000 (13:20 +0000)]
* readline.m4 (gl_FUNC_READLINE): Rewrite the cached part of the
test to be side-effect free by storing the result in the cache
variable gl_cv_lib_readline, and moving the assignment of
LIBREADLINE and LTLIBREADLINE outside the COMMANDS-TO-SET-IT.
From Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.
Paul Eggert [Sat, 4 Mar 2006 06:34:54 +0000 (06:34 +0000)]
(gl_FUNC_POLL): If we deem poll(2) unacceptable, use
our replacement poll.h in any case, to avoid a differing
declaration from a system header. Seen on AIX.