Paul Eggert [Sun, 22 Oct 2006 07:32:17 +0000 (07:32 +0000)]
* lib/canonicalize.c (ELOOP): Define if not already defined.
Problem reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2006-10/msg00282.html>.
Paul Eggert [Thu, 19 Oct 2006 07:51:14 +0000 (07:51 +0000)]
* lib/xstrtol.h: Include gettext.h.
(_STRTOL_ERROR): Wrap English-language formats inside gettext.
Problem reported by Eric Blake.
* modules/xstrtol (Depends-on): Add gettext-h.
Paul Eggert [Thu, 19 Oct 2006 07:32:18 +0000 (07:32 +0000)]
* lib/strftime.c (advance): New macro.
(add): Use it to avoid adding 0 to a FILE *. FILE can be
an incomplete type, so you can't add 0 to it. Problem reported
by Eelco Dolstra for dietlibc.
Paul Eggert [Sat, 14 Oct 2006 23:40:42 +0000 (23:40 +0000)]
Sync from Automake.
* build-aux/install-sh (posix_mkdir): Reject FreeBSD 6.1 mkdir -p -m,
which incorrectly sets the mode of an existing destination
directory. In some cases the unpatched install-sh could do the
equivalent of "chmod 777 /" or "chmod 0 /" on a buggy FreeBSD
system. We hope this is rare in practice, but it's clearly worth
fixing. Problem reported by Alex Unleashed in
<http://lists.gnu.org/archive/html/bug-autoconf/2006-10/msg00012.html>.
Also, don't bother to check for -m bugs unless we're using -m;
suggested by Stepan Kasal.
Sync from Automake.
* build-aux/depcomp (gcc3): Put dependency extraction flags before the
`-c' flag, so they appear at the same position as in %FASTDEP%
mode in depend2.am. Fixes build failure for FreeBSD's c89,
which ignores unknown options only after the first non-option.
Bug report against M4 by Nelson H. F. Beebe.
Jim Meyering [Sat, 14 Oct 2006 06:32:48 +0000 (06:32 +0000)]
Fix a bug in yesterday's change.
* lib/fts.c (fts_open): When using FTS_XDEV|FTS_NOSTAT,
p->fts_statp->st_dev would be used uninitialized.
Ensures that we always call fts_stat on the very first entry.
Miklos Szeredi reported that find -xdev stopped working.
Jim Meyering [Thu, 12 Oct 2006 13:23:10 +0000 (13:23 +0000)]
* m4/getloadavg.m4 (gl_GETLOADAVG): Test for the existence of
lib/getloadavg.c using "ls -L", not "test -f". The latter would
fail with a symlink, which is what coreutils' ./bootstrap now
creates by default.
Jim Meyering [Thu, 12 Oct 2006 10:32:32 +0000 (10:32 +0000)]
Big performance improvement for fts-based tools that use FTS_NOSTAT.
Avoid spurious inode-mismatch problems on non-POSIX file systems.
Details: http://article.gmane.org/gmane.comp.lib.gnulib.bugs/7416
* lib/fts_.h (FTS_DEFER_STAT): Define new flag.
(FTS_OPTIONMASK): Extend the mask to reflect this addition.
* lib/fts.c (DT_IS_KNOWN, DT_MUST_BE): Define.
(FTS_NO_STAT_REQUIRED, FTS_STAT_REQUIRED): Define.
(fts_set_stat_required): New function.
(fts_open): Defer the calls to fts_stat, if possible or requested.
Move the code that maps a command-line fts_info value FTS_DOT to FTS_D
into fts_stat itself.
(fts_read): Perform any required (deferred) fts_stat call.
(fts_build): Likewise, for the directory we're about to open and read.
In the readdir loop, carefully decide whether each entry will require
an eventual call to fts_stat, using dirent.d_type info if available.
(fts_stat): Move the test for whether to honor FTS_COMFOLLOW on
a command line argument into this function. Update all callers.
Map a return value of FTS_DOT to FTS_D for a command line argument.
* modules/fts (Depends-on): Add d-type. Alphabetize.
Thanks to Miklos Szeredi for his tenacity and for the initial
bug report about "find" failing on a FUSE-based file system.
Paul Eggert [Thu, 12 Oct 2006 08:01:18 +0000 (08:01 +0000)]
* m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Renamed from
gl_USE_SYSTEM_EXTENSIONS, to fix a coreutils bootstrap failure
reported by Jim Meyering. All uses of cache variables renamed
to match Autoconf's.
(gl_USE_SYSTEM_EXTENSIONS): New macro, which simply requires
the other one.
Paul Eggert [Thu, 12 Oct 2006 06:17:55 +0000 (06:17 +0000)]
* lib/inttypes_.h (_LONG_LONG_FORMAT_PREFIX): New macro.
Add support for Tandem NonStop R series.
(_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX, _SCNu64_PREFIX):
Use new macro.
Paul Eggert [Thu, 12 Oct 2006 05:36:20 +0000 (05:36 +0000)]
* lib/rename-dest-slash.c: Include stdbool.h but not string.h.
(has_trailing_slash): Omit size arg; all callers changed.
Omit 'inline', since it doesn't help performance and we'd
need to configure it.
Don't count //, ///, etc. as having a trailing slash.
As a side effect, this removes a C99ism reported by Matthew Woehlke.
(rpl_rename_dest_slash): On failure, use rename's errno rather
than (in some cases) an incorrect or junk errno.
Simplify code by removing need to compute length; this does
cause it to make two passes instead of one over the file name,
but it's worth it.
Paul Eggert [Wed, 11 Oct 2006 23:12:36 +0000 (23:12 +0000)]
* m4/extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): Undo previous
change, since Autoconf's version may no longer be appropriate now
that we are using CVS Autoconf's version. Add support for Tandem.
Paul Eggert [Wed, 11 Oct 2006 05:58:47 +0000 (05:58 +0000)]
Port to Tandem NSK OSS, which has 64-bit signed int but at most
32-bit unsigned int. Problem reported by Matthew Woehlke in:
http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00062.html
More generally, don't assume that 64-bit signed int is available
if unsigned int is, and vice versa.
* lib/inttypes_.h (_PRIu64_PREFIX, _SCNu64_PREFIX): Depend on
unsigned symbols, not on their signed counterparts.
* lib/stdint_.h (uint64_t, uint_least64_t, uint_fast64_t, uintmax_t):
(UINT64_MAX, UINT_LEAST64_MAX, UINT_FAST64_MAX, UINTMAX_MAX):
(UINT64_C, UINTMAX_C):
Likewise.
* lib/strtoimax.c (strtoll): Depend on signed symbols, not their
unsigned counterparts.
(Have_long_long, Unsigned): New macros.
(Int): Renamed from INT.
(strtoimax): Use the new macros.
* m4/stdint.m4 (gl_STDINT_H): Require AC_TYPE_UNSIGNED_LONG_LONG_INT
and substitute HAVE_UNSIGNED_LONG_LONG_INT.
* modules/inttypes (inttypes.h): Substitute
HAVE_UNSIGNED_LONG_LONG_INT.
* modules/stdint (stdint.h): Likewise.
(Files): Add m4/ulonglong.m4.
Jim Meyering [Mon, 9 Oct 2006 12:15:39 +0000 (12:15 +0000)]
* fts-cycle.c (leave_dir): When "leaving" a top level directory due
to FTS_SKIP, don't copy the parent's uninitialized dev/ino values.
Trigger with e.g., mkdir d && valgrind ./chmod u+rwx d d
Paul Eggert [Sun, 8 Oct 2006 07:24:56 +0000 (07:24 +0000)]
Don't include <config.h> twice; this doesn't work in some cases,
e.g., when config.h has "#define intmax_t long long int" and
we include <config.h>, <inttypes.h>, <config.h> in that order.
* fprintftime.c: Don't include config.h or fprintftime.h.
* fts-cycle.c: Don't include config.h.
* strftime.c: Include fprintftime.h if FPRINTFTIME is defined.
* xstrtoimax.c: Remove copyright notice since it's short tnow.
Don't include config.h or xstrtol.h. Define STRTOL_T_MINIMUM
and STRTOL_T_MAXIMUM unconditionally, since we now assume gnulib
inttypes.h.
* xstrtoumax.c: Likewise.
* xstrtol.c: Include config.h and xstrtol.h after defining
__strtol and the like, so that this module is more like its siblings.
(STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [! defined STRTOL_T_MINIMUM]:
Remove; no longer needed now that we assume gnulib inttypes.h.
Jim Meyering [Sat, 7 Oct 2006 18:57:13 +0000 (18:57 +0000)]
* modules/inttypes (inttypes.h): Revert what seems to have been
an inadvertent part of today's change: use "|", not "/" in the
substitution for the "/"-containing string, $(ABSOLUTE_INTTYPES_H).