Paul Eggert [Tue, 26 Dec 2006 01:51:36 +0000 (01:51 +0000)]
* gnulib-tool (SED): Remove, undoing previous change.
The problem was that it broke coreutils on Solaris, because
"sed --posix" leaked into a makefile.
(sed): New alias, if 'alias' and GNU sed.
Jim Meyering [Sun, 24 Dec 2006 17:08:04 +0000 (17:08 +0000)]
Work around an fchownat bug in glibc-2.4:
http://lists.ubuntu.com/archives/ubuntu-users/2006-September/093218.html
This bug would cause "chown -RP ... DIR" to follow symlinks in DIR,
in spite of the -P option.
* m4/openat.m4 (gl_FUNC_FCHOWNAT, gl_FUNC_FCHOWNAT_DEREF_BUG):
New macros.
(gl_PREREQ_OPENAT): Require gl_FUNC_FCHOWNAT.
* modules/openat (Files): Add lib/fchownat.c.
* lib/openat.c (fchownat): Don't define here. Move to...
* lib/fchownat.c: ...this new file.
Paul Eggert [Sun, 24 Dec 2006 07:55:08 +0000 (07:55 +0000)]
Fix bug reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2006-12/msg00228.html>
where quotearg.c didn't compile on Mac OS X 10.2 because it
lacks <wchar.h> and wint_t.
* lib/wctype_.h (__wctype_wint_t): New type.
Include <stdio.h>, <time.h>, <wchar.h> only if HAVE_WINT_T.
(iswalnum, iswalpha, iswblank, iswcntrl, iswdigit, iswgraph):
(iswlower, iswprint, iswpunct, iswspace, iswupper, ixwxdigit):
Arg is now of type __wctype_wint_t, not wint_t.
* m4/wctype.m4 (gl_WCTYPE_H): Require gt_TYPE_WINT_T, and
substitute HAVE_WINT_T.
* modules/wctype (Files): Add m4/wint_t.m4.
(wctype.h): Substitute HAVE_WINT_T.
Paul Eggert [Fri, 22 Dec 2006 08:53:57 +0000 (08:53 +0000)]
* m4/mktime.m4 (AC_FUNC_MKTIME): Sync from Autoconf.
Include <limits.h>, and use its INT_MAX to rewrite the
j loop so that it does not overflow 'int'. Problem reported by
Ralf Wildenhues in
<http://lists.gnu.org/archive/html/bug-gnulib/2006-12/msg00084.html>.
Play it safe by shifting left by 1 rather than multiplying by 2,
as GCC is less likely to optimize this away when the value
is signed (when it assumes overflow leads to undefined behavior).
Also, don't assume time_t uses two's complement.
Paul Eggert [Fri, 22 Dec 2006 00:21:54 +0000 (00:21 +0000)]
* MODULES.html.sh: New module wctype.
* lib/wctype_.h, m4/wctype.m4, modules/wctype: New files.
* lib/fnmatch.c: Don't bother to include <wchar.h> before
<wctype.h>, since the new wctype module should fix this.
* lib/quotearg.c: Include <wctype.h> unconditionally, since
the wctype module should arrange for it.
* lib/regex_internal.h: Likewise.
* m4/quotearg.m4 (gl_QUOTEARG): Don't check for wctype.h or iswprint,
since the wctype module should handle this now.
* m4/regex.m4 (gl_PREREQ_REGEX): Don't check for wctype.h.
* modules/fnmatch (Depends-on): Add wctype.
* modules/quotearg (Depends-on): Likewise.
* modules/regex (Depends-on): Likewise.
Paul Eggert [Mon, 18 Dec 2006 18:04:20 +0000 (18:04 +0000)]
* lib/dirname.h (DOUBLE_SLASH_IS_DISTINCT_ROOT): Default to 0, not 1.
This is more consistent with the other defines here.
* m4/double-slash-root.m4 (gl_DOUBLE_SLASH_ROOT):
Port to z/OS. Problem reported by Paul Gilmartin.
Change local vars to use gl_ prefix rather than ac_.
Don't define DOUBLE_SLASH_IS_DISTINCT_ROOT to 0, for consistency
with other defines.
* modules/double-slash-root: New module.
* modules/dirname (Files): Remove m4/double-slash-root.m4.
(Depends-on): Add double-slash-root.
* MODULES.html.sh (File system functions): Mention new module.
Paul Eggert [Thu, 14 Dec 2006 18:47:36 +0000 (18:47 +0000)]
* lib/yesno.c [!ENABLE_NLS]: Don't include getline.h.
(yesno) [!ENABLE_NLS]: Don't invoke getline or rpmatch.
This is for the benefit of gzip, which doesn't do i18n.
Paul Eggert [Tue, 12 Dec 2006 07:37:26 +0000 (07:37 +0000)]
* m4/openat.m4 (gl_FUNC_OPENAT): Don't compile mkdirat
and fchmodat unconditionally, since glibc 2.4 has them.
Problem reported by Arkadiusz Miskiewicz.
Jim Meyering [Fri, 8 Dec 2006 09:28:23 +0000 (09:28 +0000)]
* build-aux/announce-gen: Add two new options, both optional:
--bootstrap-tools=TOOL_LIST
a comma-separated list of tools, e.g.,
autoconf,automake,bison,gnulib
--gnulib-snapshot-date=DATE
if gnulib is in the bootstrap tool list,
then report this as the snapshot date.
If not specified, use the current date/time.
If you specify a date here, be sure it's UTC.
Paul Eggert [Tue, 5 Dec 2006 18:09:17 +0000 (18:09 +0000)]
* lib/utimens.c (futimens) [HAVE_BUGGY_NFS_TIME_STAMPS]: Add a
workaround for this case. It is not autoconfigured now; offhand
it's hard to see how to autoconfigure it.
Paul Eggert [Mon, 4 Dec 2006 07:23:36 +0000 (07:23 +0000)]
* lib/mkdir-p.c (make_dir_parents): Fix race condition when making
a directory that is about to be chowned. Such a directory's
initial file permissions should permit the owner only and this
should not be changed until after the chown, since the group and
other bits would be incorrect if they granted permission before
the chown.
Jim Meyering [Sun, 3 Dec 2006 10:23:10 +0000 (10:23 +0000)]
* lib/fts.c (fts_load): Don't set sp->fts_dev here, since
p->fts_statp may not yet be defined.
(fts_read): Instead, set it in the caller, once p->fts_statp is
sure to be defined, and corresponds to a top-level directory.
Jim Meyering [Sat, 2 Dec 2006 09:18:36 +0000 (09:18 +0000)]
* modules/savewd (Depends-on): Add fcntl_h to avoid self-test
build failure due to missing definition of HAVE_WORKING_O_NOFOLLOW.
Reported by Simon Josefsson.
Paul Eggert [Thu, 30 Nov 2006 23:11:30 +0000 (23:11 +0000)]
* m4/warning.m4: Use the all-permissive copyright notice
recommended by RMS (rather than LGPL).
* m4/vararrays.m4: Likewise.
* m4/flexmember.m4: Likewise.
Paul Eggert [Mon, 27 Nov 2006 07:15:26 +0000 (07:15 +0000)]
Fix some incompatibilities with gcc -ansi -pedantic.
* lib/regex.h (__restrict_arr): Don't use the [restrict] syntax
if compiling pedantically with GCC, unless it's C99 or later.
Don't trust sys/cdefs.h's definition of __restrict_arr, either, as
it mishandles gcc -ansi -pedantic as well.
* lib/regex_internal.h (re_token_t): Don't use enum bitfields
if gcc -pedantic.
* lib/regexec.c (check_node_accept_bytes): Don't use auto
initializers for struct if -pedantic, unless it's C99 or later.
Jim Meyering [Wed, 22 Nov 2006 23:48:30 +0000 (23:48 +0000)]
Work around a compile-time error from the HP-UX 11.00 /bin/cc.
* lib/fts.c (enum Fts_stat): Give this previously-anon enum a name.
(fts_read): Use a temporary to narrow the overused st_size member
before using it in a switch statement. Reported by Matthew Woehlke.
Jim Meyering [Mon, 20 Nov 2006 23:33:31 +0000 (23:33 +0000)]
The beginnings of syntax-related checks for gnulib.
* lib/Makefile: New file.
* lib/t-idcache: New script. Ensure that the two halves of
idcache.c stay in sync.
Paul Eggert [Mon, 20 Nov 2006 22:01:30 +0000 (22:01 +0000)]
* lib/openat.h (rpl_fstatat): New macro, if
[HAVE_OPENAT && ! LSTAT_FOLLOWS_SLASHED_SYMLINK.
(fstatat): Define to rpl_fstatat under the same conditions,
unless COMPILING_FSTATAT.
* m4/openat.m4 (gl_FUNC_OPENAT): Compile fstatat.c too, if fstatat
seems to have the bug.
* lib/fstatat.c: New file.
* modules/openat (Files): Add it.
Jim Meyering [Mon, 20 Nov 2006 10:54:06 +0000 (10:54 +0000)]
* lib/idcache.c: Restore most of the 2006-11-06 patch, so as to
continue using the flexible array member (thus, this module performs
half as many malloc calls), with the addition that...
(getgroup, getuser): Consistently record a non-match via an empty
"name" string, and map an empty string match to a NULL return value.
* modules/idcache (Depends-on): Re-add flexmember.
Paul Eggert [Mon, 20 Nov 2006 09:10:18 +0000 (09:10 +0000)]
* lib/idcache.c: Undo most recent patch, dated 2006-11-06.
It mishandled the case where the group was missing.
Problem reported by Greg Schafer.
* modules/idcache: Likewise.
Bruno Haible [Wed, 15 Nov 2006 20:50:54 +0000 (20:50 +0000)]
No need to invoke gl_FUNC_ALLOCA more than once. But using AC_REQUIRE would
be wrong here, since gl_FUNC_ALLOCA calls AC_FUNC_ALLOCA which has an effect
on @ALLOCA@.