Eric Blake [Wed, 19 Dec 2007 23:09:03 +0000 (16:09 -0700)]
Fix memmem to avoid O(n^2) worst-case complexity.
* lib/memmem.c (knuth_morris_pratt): New function.
(memmem): Use it if first few naive iterations fail.
* m4/memmem.m4 (gl_FUNC_MEMMEM): Detect cygwin bug.
* modules/memcmp (License): Set to LGPLv2+, not LGPL.
* modules/memchr (License): Likewise.
* modules/memmem (Depends-on): Add memcmp, memchr, stdbool, and
malloca.
* tests/test-memmem.c: Rewrite, borrowing ideas from
test-mbsstr1.c; the old version wouldn't even compile!
* modules/memmem-tests: New file.
* lib/string.in.h (rpl_memmem): Add declaration.
* modules/string (Makefile.am): Substitute REPLACE_MEMMEM.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Default for
REPLACE_MEMMEM.
Paul Eggert [Wed, 19 Dec 2007 00:11:25 +0000 (16:11 -0800)]
Fix problem with _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H on VMS.
* lib/stdint.in.h (_GL_JUST_INCLUDE_SYSTEM_INTTYPES_H): Define
before any system include files, and undef after them all. This
should fix a problem on VMS reported by John E. Malmberg in
<http://lists.gnu.org/archive/html/bug-gnulib/2007-12/msg00118.html>.
Eric Blake [Tue, 18 Dec 2007 04:50:40 +0000 (21:50 -0700)]
Revert addition of verify, for BSD/OS.
* lib/fseeko.c [!HAVE_FSEEKO]: Allow off_t > long, even though it
can't handle large files, for the sake of obsolete platforms.
* modules/fseeko (Depends-on): Remove verify.
* doc/functions/fseeko.texi (fseeko): Document BSD/OS limitation.
* doc/functions/ftello.texi (ftello): Likewise.
* doc/functions/fgetpos.texi (fgetpos): Likewise.
Reported by Larry Jones.
Jim Meyering [Fri, 14 Dec 2007 18:46:26 +0000 (19:46 +0100)]
Port to GNU/kFreeBSD - FreeBSD kernel + GNU libc,
which has no openat syscall, yet <fcntl.h> does define AT_FDCWD.
* lib/getcwd.c: Undef AT_FDCWD if there is no openat function.
* modules/getcwd (Depends-on): Add openat.
Reported by Petr Salinger.
Eric Blake [Thu, 13 Dec 2007 21:58:44 +0000 (14:58 -0700)]
Another fseek test.
* tests/test-fseek.c (main): Also test ungetc handling.
* tests/test-fseeko.c (main): Likewise.
* modules/fseeko (Depends-on): Add verify.
* lib/fseeko.c [!HAVE_FSEEKO]: Verify that off_t is not too
large.
Reported by Larry Jones.
Eric Blake [Tue, 11 Dec 2007 21:00:26 +0000 (14:00 -0700)]
Fix bug with -0.0L in previous patch.
* lib/isnan.c (rpl_isnanl): Make robust to -0.0L and pad bits.
* tests/test-isnan.c (main): Also test on zeroes.
* tests/test-isnanf.c (main): Likewise.
* tests/test-isnanl.h (main): Likewise.
Eric Blake [Tue, 11 Dec 2007 18:35:55 +0000 (11:35 -0700)]
Detect pseudo-denormals on x86 even when cross-compiling.
* lib/isnan.c (rpl_isnanl) [!KNOWN_EXPBIT0_LOCATION
&& USE_LONG_DOUBLE && x86]: Add one more check to filter out
invalid bit patterns that happen to satisfy ==.
Jim Meyering [Fri, 7 Dec 2007 15:20:57 +0000 (16:20 +0100)]
Let these macros work also with autoconf-2.59.
* m4/getline.m4 (gl_FUNC_GETLINE): Require only autoconf-2.59. 2.60
is not needed, since gnulib now permits use of AC_CHECK_DECLS_ONCE.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Likewise.
Eric Blake [Tue, 4 Dec 2007 15:38:22 +0000 (08:38 -0700)]
Make cygwin fseeko check more reliable.
* m4/stdio_h.m4 (gl_STDIN_LARGE_OFFSET) [__CYGWIN__]: Use cygwin
version numbers, rather than unrelated feature check.
* doc/functions/fseeko.texi (fseeko): Tweak failure report.
* doc/functions/ftello.texi (ftello): Likewise.
Reported by Bruno Haible.
Paul Eggert [Mon, 3 Dec 2007 23:30:36 +0000 (15:30 -0800)]
Add support for Solaris 10 ACLs. Also, ACLs are Gnulib, not Autoconf.
* modules/acl (configure.ac): Rename AC_FUNC_ACL to gl_FUNC_ACL.
* m4/acl.m4 (gl_FUNC_ACL): Renamed from AC_FUNC_ACL. On Solaris,
put -lsec in even for programs other than 'ls'. This fixes a problem
for gettext reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2007-12/msg00007.html>.
* lib/acl.c (copy_acl, qset_acl) [USE_ACL && defined ACL_NO_TRIVIAL]:
Add support for Solaris 10. This isn't efficient, but should get the
job done for now.
Jim Meyering [Sat, 1 Dec 2007 14:34:41 +0000 (15:34 +0100)]
Fix a 4-year-old used-uninitialized bug in regcomp.c.
* lib/regcomp.c (optimize_utf8): Fix a typo, s/idx/ctx_type/,
that would inhibit utf8-optimization of a regexp containing line-
or buffer-anchors, e.g., `^', `$'.
Ralf Wildenhues [Sun, 25 Nov 2007 16:09:25 +0000 (17:09 +0100)]
* doc/fdl.texi, doc/gpl-3.0.texi, doc/lgpl-3.0.texi:
Sync from <http://gnu.org/licenses>.
* modules/agpl-3.0, doc/agpl-3.0.texi: New module,
with license text from same location.
* doc/maintain.texi, doc/standards.texi: Sync from
<http://savannah.gnu.org/projects/gnustandards>.
Ondřej Vašík [Thu, 22 Nov 2007 21:13:20 +0000 (22:13 +0100)]
Adjust getdate's grammar to accept a slightly more regular language.
E.g., accept "YYYYMMDD +N days" as well as "YYYYMMDD N days".
Before, the former was rejected.
* lib/getdate.y (digits_to_date_time): New function, factored
out of ...
(number): ...here. Just call digits_to_date_time.
(hybrid): New non-terminal to handle an <unsigned number,
signed relative offset> sequence consistently.
Jim Meyering [Sun, 18 Nov 2007 10:51:26 +0000 (11:51 +0100)]
Pull my changes from coreutils:
bootstrap: fix typo to enable use of $gnulib_tool_option_extras.
* build-aux/bootstrap (gnulib_tool_options): Add a space before the
use of $gnulib_tool_option_extras, so that it's separated from the
preceding argument.
Fix bootstrap failure to handle files like lib/uniwidth/cjk.h.
* build-aux/bootstrap (cp_mark_as_generated): Create any required
parent destination directories before copying a file into place.
Paul Eggert [Fri, 16 Nov 2007 19:18:36 +0000 (11:18 -0800)]
Port test-getaddrinfo to Solaris.
Problem reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2007-03/msg00171.html>.
* tests/test-getaddrinfo.c (simple): Add a comment asking for an
explanation of setting 'hints'.
(SERV1, SERV2, SERV3): Don't use "http" and "https"; this doesn't
work in Solaris 10 and earlier.
Paul Eggert [Fri, 16 Nov 2007 00:28:05 +0000 (16:28 -0800)]
New module posix-shell, for determining a POSIX shell
or perhaps something that is close enough to a POSIX shell.
* m4/posix-shell.m4: New file.
* modules/posix-shell: New file.
* MODULES.html.sh: Mention new module.
Paul Eggert [Mon, 12 Nov 2007 23:50:17 +0000 (15:50 -0800)]
Don't insist on 'long long int' support in the preprocessor. It
breaks too many things. For example, PRIdMAX still uses a 'long
long int' format with the latest Sun compiler, even though
HAVE_LONG_LONG_INT isn't defined due to that compiler's
preprocessor problem. This causes the latest coreutils to dump
core on Solaris 10 sparc with the Sun C compiler.
Instead, fix the 2007-10-16 problem in a different way, by evaluating
the troublesome expressions at configure-time, not at #if-time.
* m4/longlong.m4 (_AC_TYPE_LONG_LONG_SNIPPET): Don't test the
preprocessor.
* m4/inttypes.m4 (gl_INTTYPES_H): Move the #if checks into
compile-time C checks, done at 'configure'-time.
(gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION): New macro.
* modules/inttypes (Makefile): Substitute the new symbols that
gl_INTTYPES_H now generates.
* lib/inttypes.in.h: Don't use constants wider than 'long' in #if.