Jim Meyering [Sun, 25 Jun 2006 18:26:09 +0000 (18:26 +0000)]
* NEWS: wc accepts a new option --files0-from=FILE, where FILE
contains a list of NUL-separated file names.
* src/wc.c: Include "readtokens.h".
(usage): Describe the new option, and adjust the `Usage':
with this option, no FILE may be specified on the command line.
(main): Handle the new option.
* tests/misc/wc-files0: New tests, for the above.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/Makefile.am (TESTS): Add wc-files0.
Paul Eggert [Tue, 20 Jun 2006 05:59:16 +0000 (05:59 +0000)]
(gl_IGNORE_UNUSED_LIBRARIES):
Use -Wl,--as-needed, not bare --as-needed, since HP-UX 11.11
cc merely issues a bunch of annoying warnings for --as-needed
(this problem was reported by Bob Proulx). Also, try linking with
-lm to detect a bug in binutils 2.16 (this problem was reported
by Ralf Wildenhues).
Jim Meyering [Sun, 18 Jun 2006 21:52:03 +0000 (21:52 +0000)]
Test for a bug that causes glibc's getcwd to suffer a failed assertion.
* getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): New file and macro.
* getcwd.m4 (gl_FUNC_GETCWD): If we detect support for getcwd_null,
also check for glibc-2.4's abort-inducing bug.
Jim Meyering [Sun, 18 Jun 2006 14:29:29 +0000 (14:29 +0000)]
* getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Fix typo.
Low-probability clean-up should be to use rmdir to get rid of
the just-created directory, not unlink.
Jim Meyering [Sun, 18 Jun 2006 14:00:34 +0000 (14:00 +0000)]
* ftruncate.m4 (gl_FUNC_FTRUNCATE): If ftruncate is missing, make
configure fail, and request a bug report to inform us about it.
Add a comment that, barring reports to the contrary, in 2007 we'll
assume ftruncate is universally available.
Jim Meyering [Sun, 11 Jun 2006 08:12:37 +0000 (08:12 +0000)]
Setting TIME_STYLE=long-iso in the environment would make the
cp/same-file test fail.
* tests/envvar-check (vars): Add TIME_STYLE to the list.
* tests/cp/same-file: Revert last change.
Source the envvar-check script, to ensure that TIME_STYLE
settings don't affect these tests.
Paul Eggert [Sun, 11 Jun 2006 07:59:16 +0000 (07:59 +0000)]
* tests/cp/same-file: Execute 'ls' in the C locale, so that it
uses POSIX time stamp formats. Problem reported by John Nixon in
<http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00062.html>.
Jim Meyering [Sat, 10 Jun 2006 09:01:41 +0000 (09:01 +0000)]
Apply this change from gnulib:
2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Bruno Haible <bruno@clisp.org>
* strndup.m4 (gl_FUNC_STRNDUP): Replace the AC_REPLACE_FUNCS with a
check for the declaration of strnlen and a run test that exposes the
AIX 5.1 strnlen bug. In the failure case, #define strndup to
rpl_strndup.
Jim Meyering [Thu, 8 Jun 2006 20:13:37 +0000 (20:13 +0000)]
Ensure that cat works with any of the options, -A -v -e -E -T,
when applied to files in /proc and /sys, even when the FIONREAD
ioctl produces nonsensical results. Before this change, cat would
produce no output (or truncated output), for some linux kernels.
* src/cat.c (write_pending): New function, factored out of cat.
(cat): Also interpret a negative ioctl/FIONREAD count as indicating
that there are bytes to read. Some versions of linux-2.6.16 do that.
Write any pending output before returning.
Reported by Dan Jacobson in <http://bugs.debian.org/370583>.
* NEWS: Mention this bug fix.
* tests/misc/cat-proc: New file. Test for the above.
* tests/misc/Makefile.am (TESTS): Add cat-proc.
Jim Meyering [Sat, 3 Jun 2006 09:04:22 +0000 (09:04 +0000)]
Make `cp --link --no-dereference' work also on systems where the
link system call cannot create a hard link to a symbolic link.
(copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use
the link syscall on a symlink when it would do the wrong thing.
Based on the patch by Aurelien Jarno: <http://bugs.debian.org/329451>
Jim Meyering [Sat, 3 Jun 2006 09:03:19 +0000 (09:03 +0000)]
Test for this:
Make `cp --link --no-dereference' work also on systems where the
link system call cannot create a hard link to a symbolic link.
* src/copy.c (copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use
the link syscall on a symlink when it would do the wrong thing.
Based on the patch by Aurelien Jarno: <http://bugs.debian.org/329451>
Jim Meyering [Sun, 28 May 2006 09:32:54 +0000 (09:32 +0000)]
AIX 4.3.3 gives a different diagnostic.
Recognize it, too. Reported by Ralf Wildenhues, in
http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
Jim Meyering [Sat, 27 May 2006 14:44:41 +0000 (14:44 +0000)]
Support new options: --preserve-root and --no-preserve-root.
Somehow this program was skipped when those options were added to chown,
chmod, and rm. Reported by vaqflabuopac@spammotel.com in
<http://bugs.debian.org/365656>.
Paul Eggert [Thu, 25 May 2006 21:57:22 +0000 (21:57 +0000)]
(small_open, large_open): New macros.
(__open, __open64) [!_LIBC]: Remove.
(__gen_tempname): Use small_open and large_open instead of __open
and __open64. This fixes a portability bug on HP-UX 11.11i
reported by Simon Wing-Tang in
<http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
Paul Eggert [Mon, 22 May 2006 20:11:45 +0000 (20:11 +0000)]
* filemode.c (setst): Remove.
(strmode): Rewrite to avoid setst. This makes the code shorter,
(arguably) clearer, and the generated code is a bit smaller on my
Debian GNU/Linux stable x86 host.
Jim Meyering [Sat, 20 May 2006 07:19:53 +0000 (07:19 +0000)]
(main): Rename local, s/symlink_deref_bit/symlink_deref_bits/
and arrange for -D to set fts' FTS_PHYSICAL bit as well as
FTS_COMFOLLOW. Spotted by Justin Pryzby.