platform/upstream/coreutils.git
17 years ago* tests/readlink/can-e: Put the closing double-quote at the end of a
Bruno Haible [Sat, 24 Feb 2007 07:22:08 +0000 (08:22 +0100)]
* tests/readlink/can-e: Put the closing double-quote at the end of a
backquoted word, not in the middle. Works around a bug in sh on
OSF/1 4.0d.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.

17 years ago* tests/du/slink: Skip the test if executing on an nfsv3 file system.
Bruno Haible [Sat, 24 Feb 2007 07:20:37 +0000 (08:20 +0100)]
* tests/du/slink: Skip the test if executing on an nfsv3 file system.
This avoids a test failure at least on OSF/1 4.0d.

17 years ago* randperm.c (randperm_new): Comment: say that this function
Jim Meyering [Fri, 23 Feb 2007 21:16:12 +0000 (22:16 +0100)]
* randperm.c (randperm_new): Comment: say that this function
returns a pointer to malloc'd storage.

17 years ago* src/date.c (usage): Split a diagnostic that had grown to be
Jim Meyering [Fri, 23 Feb 2007 16:50:40 +0000 (17:50 +0100)]
* src/date.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.

17 years ago* src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
Ed Santiago [Fri, 23 Feb 2007 15:11:01 +0000 (16:11 +0100)]
* src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
for a separator.  Include sample RFC 2822 and 3339 output.

17 years agoWith -Dlint, make shuf free all heap-allocated storage.
Jim Meyering [Fri, 23 Feb 2007 14:18:16 +0000 (15:18 +0100)]
With -Dlint, make shuf free all heap-allocated storage.
* src/shuf.c (main): Move declaration of input_lines to
function scope, and initialize to NULL, so we can free it.
[lint]: Free all malloc'd memory.
* tests/misc/shuf: Also test shuf's -e and -i options.

17 years agoCorrect typo in ChangeLog entry.
Jim Meyering [Thu, 22 Feb 2007 22:51:43 +0000 (23:51 +0100)]
Correct typo in ChangeLog entry.

17 years agoMerge in a change from some other incarnation of this file (gzip?)
Jim Meyering [Thu, 22 Feb 2007 22:37:19 +0000 (23:37 +0100)]
Merge in a change from some other incarnation of this file (gzip?)
* bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir.

17 years agoHonor dd's noatime flag if possible, even if not supported on build fs
Paul Eggert [Thu, 22 Feb 2007 18:09:35 +0000 (19:09 +0100)]
Honor dd's noatime flag if possible, even if not supported on build fs
* doc/coreutils.texi (dd invocation): Warn that noatime might not be
reliable.
* src/dd.c (flags, usage): Look at O_NOATIME, not
HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
flag, so that dd attempts O_NOATIME even if the build file system
does not support it.  Problem reported by Jim Meyering today in
bug-coreutils.
* tests/dd/misc: Generate a warning, not a failure, if noatime
exists but fails.

17 years agoAdjust preceding change not to perform an unaligned access.
Jim Meyering [Thu, 22 Feb 2007 15:32:45 +0000 (16:32 +0100)]
Adjust preceding change not to perform an unaligned access.
* src/copy.c (copy_reg): Undo previous change.  Instead, make
it clearer that we're using a single-byte sentinel, and
[lint]: Initialize uintptr_t-1 bytes after the sentinel.
Reported by Andreas Schwab.

17 years agoPlacate valgrind, wrt ./cp --sparse=always
Jim Meyering [Thu, 22 Feb 2007 11:50:36 +0000 (12:50 +0100)]
Placate valgrind, wrt ./cp --sparse=always
* src/copy.c (copy_reg): Place the sentinel by setting a
full word's worth of bits, not just a single byte's worth.
This avoids a harmless (but distracting) case of memory being
used-uninitialized.

17 years agoAdd to .cvsignore and .gitignore files.
Jim Meyering [Wed, 21 Feb 2007 21:45:09 +0000 (22:45 +0100)]
Add to .cvsignore and .gitignore files.

17 years ago* tests/misc/date: Remove vestigial use of Data::Dumper.
Jim Meyering [Wed, 21 Feb 2007 16:26:32 +0000 (17:26 +0100)]
* tests/misc/date: Remove vestigial use of Data::Dumper.

17 years ago* src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
Paul Eggert [Wed, 21 Feb 2007 16:23:05 +0000 (17:23 +0100)]
* src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
about out-of-range initializer with Sun C 5.8.

17 years ago* bootstrap (CVS_only_file): Use README-hacking.
Jim Meyering [Tue, 20 Feb 2007 21:44:15 +0000 (22:44 +0100)]
* bootstrap (CVS_only_file): Use README-hacking.

17 years ago* README-hacking: Update to reflect that we now use git.
Jim Meyering [Tue, 20 Feb 2007 21:42:56 +0000 (22:42 +0100)]
* README-hacking: Update to reflect that we now use git.

17 years agoNow that we use GIT, not cvs, rename README-cvs.
Jim Meyering [Tue, 20 Feb 2007 21:37:18 +0000 (22:37 +0100)]
Now that we use GIT, not cvs, rename README-cvs.
* README-hacking: Renamed from...
* README-cvs: ...this.

17 years ago* src/env.c (main): When invoked with no arguments (i.e. when printing
Jim Meyering [Tue, 20 Feb 2007 16:23:51 +0000 (17:23 +0100)]
* src/env.c (main): When invoked with no arguments (i.e. when printing
the environment), use a local variable to iterate through the global
"environ" array, rather than "environ" itself.  This is solely to
avoid changing the environment for an LD_PRELOAD-substituted "puts"
or "exit" function.  Tiny patch by Harvey Eneman.  See
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9735>.
* THANKS: Update.

17 years ago* bootstrap: Move definitions of temporary directory names and the
Jim Meyering [Tue, 20 Feb 2007 16:20:22 +0000 (17:20 +0100)]
* bootstrap: Move definitions of temporary directory names and the
new bt_regex "up" to precede all uses, so it's clearer what their
scope is.  Also, use [.], rather than \\., since the former works
even if eval'd.

17 years ago* bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
Jim Meyering [Tue, 20 Feb 2007 16:08:10 +0000 (17:08 +0100)]
* bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
Based on the bison 2007-02-19 change by Joel E. Denny.

17 years ago* NEWS: sort now uses a --compress-program option rather than
Paul Eggert [Mon, 19 Feb 2007 21:11:18 +0000 (22:11 +0100)]
* NEWS: sort now uses a --compress-program option rather than
an environment variable.
* doc/coreutils.texi (sort invocation): Document this.
* src/sort.c (usage): Likewise.
(COMPRESS_PROGRAM_OPTION): New const.
(long_options, create_temp, main): Support new option.
* tests/misc/sort-compress: Test it.

17 years ago* bootstrap: Fix typo s/dowloading/downloading/ in --help output.
Jim Meyering [Mon, 19 Feb 2007 17:44:21 +0000 (18:44 +0100)]
* bootstrap: Fix typo s/dowloading/downloading/ in --help output.

17 years agoAdd to .cvsignore and .gitignore files.
Jim Meyering [Sun, 18 Feb 2007 21:40:52 +0000 (22:40 +0100)]
Add to .cvsignore and .gitignore files.

17 years agoRely on gnulib-generated stdlib.h, not exit.h.
Jim Meyering [Sun, 18 Feb 2007 21:34:37 +0000 (22:34 +0100)]
Rely on gnulib-generated stdlib.h, not exit.h.
* src/system.h: Don't include exit.h, now that it's subsumed
by the gnulib-generated stdlib.h.
* lib/xfts.c: Include <stdlib.h> rather than exit.h, now that stdlib.h

17 years ago* tests/rm/fail-eacces: Skip this test when running as root.
Jim Meyering [Sun, 18 Feb 2007 16:40:06 +0000 (17:40 +0100)]
* tests/rm/fail-eacces: Skip this test when running as root.
Reported by Matthew Woehlke.

17 years ago* bootstrap: Use "._bootmp" as the temporary directory name,
Jim Meyering [Sun, 18 Feb 2007 11:06:01 +0000 (12:06 +0100)]
* bootstrap: Use "._bootmp" as the temporary directory name,
not ".#bootmp".  The latter's "#" caused trouble with the new,
gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line.

17 years ago* bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
Paul Eggert [Thu, 15 Feb 2007 07:16:30 +0000 (08:16 +0100)]
* bootstrap.conf (gnulib_modules): Add c-strcase.  Remove strcase.
* src/dircolors.c: Include c-strcase.h.
(dc_parse_stream): Use c_strcasecmp rather than
strcasecmp to avoid unreliable results in locales like Turkish
where strcasecmp is incompatible with the C locale.

17 years agoAlso check for and print stderr output, in case a program fails.
Jim Meyering [Tue, 13 Feb 2007 21:27:27 +0000 (22:27 +0100)]
Also check for and print stderr output, in case a program fails.
* tests/misc/tty-eof: Occasionally (not reproducible), this
test would fail, with one or more programs exiting nonzero, e.g.,
tty-eof: sha224sum exited with status 1 (expected 0)
Now, maybe we'll get a clue, the next time that happens.

17 years ago* .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script.
Jim Meyering [Mon, 12 Feb 2007 19:09:12 +0000 (20:09 +0100)]
* .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script.

17 years ago* tests/misc/pwd-unreadable-parent: Skip the test if we're
Jim Meyering [Mon, 12 Feb 2007 00:20:20 +0000 (01:20 +0100)]
* tests/misc/pwd-unreadable-parent: Skip the test if we're
definitely using the replacement.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.

17 years agoRemove excess leading spaces that would make help2man misbehave.
Jim Meyering [Sat, 10 Feb 2007 21:30:18 +0000 (22:30 +0100)]
Remove excess leading spaces that would make help2man misbehave.
* src/printf.c (usage): Remove excess spaces on 2nd line of %b desc.
* src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc.
* src/dd.c (usage): Remove excess spaces on 2nd line of sync desc.
* src/date.c (usage): Use two spaces after each optional flag, not one.
Reported by Thomas Huriaux in <http://bugs.debian.org/410407>.

17 years ago* Makefile.maint (longopt_re): Relax the regexp, making square
Jim Meyering [Sat, 10 Feb 2007 15:17:41 +0000 (16:17 +0100)]
* Makefile.maint (longopt_re): Relax the regexp, making square
brackets optional, so it matches the newly reported violations, too.

17 years ago* src/csplit.c (usage): Use two spaces (not one) to separate
Jim Meyering [Sat, 10 Feb 2007 15:15:34 +0000 (16:15 +0100)]
* src/csplit.c (usage): Use two spaces (not one) to separate
each option string from its description, so help2man formats
the derived man page properly.  Reported by Thomas Huriaux in
<http://bugs.debian.org/410407>.
* src/df.c (usage): Likewise.
* src/du.c (usage): Likewise.
* src/install.c (usage): Likewise.
* src/ls.c (usage): Likewise.

17 years agoTest for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
Jim Meyering [Sat, 3 Feb 2007 19:02:48 +0000 (20:02 +0100)]
Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
* NEWS: Mention the bug fix.
* tests/misc/pwd-unreadable-parent: New file.
* tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent.

17 years ago* NEWS: Document fix for cp --preserve=mode.
Paul Eggert [Sat, 3 Feb 2007 17:45:46 +0000 (18:45 +0100)]
* NEWS: Document fix for cp --preserve=mode.
* src/copy.c (copy_internal): Omit the group- or other-writeable
permissions when creating a directory, to avoid a race condition
if the special mode bits aren't right just after the directory is
created.
* src/cp.c (make_dir_parents_private): Likewise.
* tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
race fix in copy.c.

17 years ago* NEWS: Document fix for cp --parents.
Paul Eggert [Sat, 3 Feb 2007 17:12:11 +0000 (18:12 +0100)]
* NEWS: Document fix for cp --parents.
* src/cp.c (make_dir_parents_private): Report the error sooner with
"cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
creating the directory, DEST/DIR.
* tests/cp/cp-parents: Test for the non-race-condition bug fixed
by the above change.

17 years ago* src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0".
Jim Meyering [Fri, 2 Feb 2007 07:57:47 +0000 (08:57 +0100)]
* src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0".

17 years ago* src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
Jim Meyering [Fri, 2 Feb 2007 00:22:58 +0000 (01:22 +0100)]
* src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
consistent, so this can be applied with patch -p0.
Reported by Matthew Woehlke.

* Makefile.maint (patch-check): Use patch with its -p2 option,
since that makes this check slightly more strict.

17 years ago* vc-list-files: Select column 2, not 3 (hg-0.9.3's manifest format
Jim Meyering [Tue, 30 Jan 2007 22:07:38 +0000 (23:07 +0100)]
* vc-list-files: Select column 2, not 3 (hg-0.9.3's manifest format
now has only two columns).

17 years ago* coreutils.texi: @item -> @itemx to fix some typos.
Paul Eggert [Tue, 30 Jan 2007 21:56:48 +0000 (22:56 +0100)]
* coreutils.texi: @item -> @itemx to fix some typos.

17 years ago* coreutils.texi (mkdir invocation): Say how to set the file
Paul Eggert [Tue, 30 Jan 2007 21:54:34 +0000 (22:54 +0100)]
* coreutils.texi (mkdir invocation): Say how to set the file
permission bits of a parent directory with mkdir -p.

17 years agoDocument new syntax: "chown +0:+287 file", "chgrp +99 file"
Jim Meyering [Mon, 29 Jan 2007 17:09:57 +0000 (18:09 +0100)]
Document new syntax: "chown +0:+287 file", "chgrp +99 file"
* coreutils.texi (Disambiguating names and IDs): New section.
(chown invocation, chgrp invocation): Mention the new syntax
with an xref to the new section.

17 years agoRegenerate .cvsignore and .gitignore files.
Jim Meyering [Mon, 29 Jan 2007 14:38:50 +0000 (15:38 +0100)]
Regenerate .cvsignore and .gitignore files.

17 years agoPlug a leak in ls.
Jim Meyering [Mon, 29 Jan 2007 13:18:28 +0000 (14:18 +0100)]
Plug a leak in ls.
* src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
determine dev/inode or upon detecting a symlink loop.

17 years ago* src/ls.c: Rename three global variables.
Jim Meyering [Mon, 29 Jan 2007 13:06:45 +0000 (14:06 +0100)]
* src/ls.c: Rename three global variables.
(cwd_file): Rename from 'files'.
(cwd_n_alloc): Rename from 'nfiles'.
(cwd_n_used): Rename from 'files_index'.

17 years agoShave 8 bytes off the size of "struct fileinfo".
Jim Meyering [Mon, 29 Jan 2007 11:25:01 +0000 (12:25 +0100)]
Shave 8 bytes off the size of "struct fileinfo".
* src/ls.c (fileinfo): Put all members of type "bool" together.

17 years agoModify "ls" to sort its data faster, using the new gnulib mpsort
Paul Eggert [Mon, 29 Jan 2007 11:08:52 +0000 (12:08 +0100)]
Modify "ls" to sort its data faster, using the new gnulib mpsort
module rather than qsort.  This is particularly a win in
environments where strcoll is slow, since mpsort typically calls
strcoll less often than qsort does.
* bootstrap.conf (gnulib_modules): Add mpsort.
* src/ls.c: Include mpsort.h.
(sorted_file, sorted_file_alloc): New vars, for a new vector of
pointers to the file info, for speed.
(clear_files, extract_dirs_from_files, sort_files, print_current_files):
(print_many_per_line, print_horizontal, print_with_commas):
(calculate_columns): Set and use new vector.
(initialize_ordering_vector): New function.

17 years agoRegenerate .cvsignore and .gitignore files, and reflect recent removal
Jim Meyering [Fri, 26 Jan 2007 23:08:36 +0000 (00:08 +0100)]
Regenerate .cvsignore and .gitignore files, and reflect recent removal
of string.h-related lib/*.h files

17 years agoAdjust to today's change to gnulib, which added a module for
Paul Eggert [Fri, 26 Jan 2007 22:58:37 +0000 (23:58 +0100)]
Adjust to today's change to gnulib, which added a module for
string.h to replace the little include files like strcase.h.
* src/dircolors.c: Don't include strcase.h.
* src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h.

17 years ago* src/dd.c (advance_input_after_read_error): Change diagnostic to
Jim Meyering [Fri, 26 Jan 2007 15:37:37 +0000 (16:37 +0100)]
* src/dd.c (advance_input_after_read_error): Change diagnostic to
say "invalid file offset" rather than "screwy file offset".

17 years ago* .x-sc_cast_of_argument_to_free: Remove this file.
Jim Meyering [Fri, 26 Jan 2007 10:11:15 +0000 (11:11 +0100)]
* .x-sc_cast_of_argument_to_free: Remove this file.
* Makefile.am (EXTRA_DIST): Likewise.

17 years ago* src/sort.c (create_temp): Remove superfluous access-X_OK
Dan Hipschman [Thu, 25 Jan 2007 20:56:32 +0000 (21:56 +0100)]
* src/sort.c (create_temp): Remove superfluous access-X_OK
check.  find_in_path does this for us.

17 years agoRemove usually-skipped test.
Jim Meyering [Wed, 24 Jan 2007 09:34:45 +0000 (10:34 +0100)]
Remove usually-skipped test.
* tests/cp/open-perm-race: Remove this file.  It is subsumed
by parent-perm-race.
* tests/cp/Makefile.am (TESTS): Remove open-perm-race.
* tests/sort/Makefile.am: Regenerate.

17 years agoPass "make distcheck" again.
Jim Meyering [Wed, 24 Jan 2007 08:32:56 +0000 (09:32 +0100)]
Pass "make distcheck" again.
* src/sort.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.
* .x-sc_cast_of_argument_to_free: New file.  Allow a cast in sort.c.
FIXME: this is just temporary, while we wait to remove the offending
access-calling code.
* Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free.
* Makefile.maint (sc_cast_of_argument_to_free): Use the
canonical, $$($(CVS_LIST_EXCEPT)).
* m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update.

17 years ago* NEWS: New option sort -C, proposed by XCU ERN 127, which looks
Paul Eggert [Wed, 24 Jan 2007 08:06:57 +0000 (09:06 +0100)]
* NEWS: New option sort -C, proposed by XCU ERN 127, which looks
like it will be approved.  Also add --check=quiet, --check=silent
as long aliases, and --check=diagnose-first as an alias for -c.
* doc/coreutils.texi (sort invocation): Document this.
Also, mention that sort -c can take at most one file.
* src/sort.c: Implement this.
Include argmatch.h.
(usage): Document the change.
(CHECK_OPTION): New constant.
(long_options): --check now takes an optional argument, and is now
treated differently from 'c'.
(check_args, check_types): New constant arrays.
(check): New arg CHECKONLY, which suppresses diagnostic if -C.
(main): Parse the new options.
* tests/sort/Test.pm (02d, 02d, incompat5, incompat6):
New tests for -C.

17 years agoFix a typo.
Jim Meyering [Wed, 24 Jan 2007 07:54:51 +0000 (08:54 +0100)]
Fix a typo.
* tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.

17 years agoDon't depend on "which".
Jim Meyering [Tue, 23 Jan 2007 23:34:54 +0000 (00:34 +0100)]
Don't depend on "which".
* tests/misc/sort-compress (SORT): Use $abs_builddir, now which.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir.

17 years agoTest sort compression.
Dan Hipschman [Tue, 23 Jan 2007 23:27:01 +0000 (00:27 +0100)]
Test sort compression.
* tests/misc/Makefile.am: Add the test.
* tests/misc/sort-compress: New file containing the tests.

17 years ago* NEWS: sort temp file compression: tweak wording.
Jim Meyering [Tue, 23 Jan 2007 23:22:45 +0000 (00:22 +0100)]
* NEWS: sort temp file compression: tweak wording.
* src/sort.c (struct sortfile) [name]: Declare member to be const.

17 years ago* src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
Dan Hipschman [Tue, 23 Jan 2007 23:00:21 +0000 (00:00 +0100)]
* src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
In pipe_fork callers, use these named constants, not "2" and "8".
(proctab, nprocs): Declare to be "static".
(pipe_fork) [lint]: Initialize local, pid,
to avoid unwarranted may-be-used-uninitialized warning.
(create_temp): Use the active voice.  Describe parameters, too.

2007-01-21  James Youngman  <jay@gnu.org>

Centralize all the uses of sigprocmask().  Don't restore an invalid
saved mask.
* src/sort.c (enter_cs, leave_cs): New functions for protecting
code sequences against signal delivery.
* (exit_cleanup): Use enter_cs and leave_cs instead of
calling sigprocmask directly.
(create_temp_file, pipe_fork, zaptemp): Likewise

2007-01-21  Dan Hipschman  <dsh@linux.ucla.edu>

Add compression of temp files to sort.
* NEWS: Mention this.
* bootstrap.conf: Import findprog.
* configure.ac: Add AC_FUNC_FORK.
* doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
variable.
* src/sort.c (compress_program): New global, holds the name of the
external compression program.
(struct sortfile): New type used by mergepfs and friends instead
of filenames to hold PIDs of compressor processes.
(proctab): New global, holds compressor PIDs on which to wait.
(enum procstate, struct procnode): New types used by proctab.
(proctab_hasher, proctab_comparator): New functions for proctab.
(nprocs): New global, number of forked but unreaped children.
(reap, reap_some): New function, wait for/cleanup forked processes.
(register_proc, update_proc, wait_proc): New functions for adding,
modifying and removing proctab entries.
(create_temp_file): Change parameter type to pointer to file
descriptor, and return type to pointer to struct tempnode.
(dup2_or_die): New function used in create_temp and open_temp.
(pipe_fork): New function, creates a pipe and child process.
(create_temp): Creates a temp file and possibly a compression
program to which we filter output.
(open_temp): Opens a compressed temp file and creates a
decompression process through which to filter the input.
(mergefps): Change FILES parameter type to struct sortfile array
and update access accordingly.  Use open_temp and reap_some.
(avoid_trashing_input, merge): Change FILES parameter like
mergefps and call create_temp instead of create_temp_file.
(sort): Call create_temp instead of create_temp_file.
Use reap_some.
(avoid_trashing_input, merge, sort, main): Adapt to mergefps.

17 years ago* tests/misc/pwd-long: Work properly even when run from the
Jim Meyering [Sat, 20 Jan 2007 20:58:31 +0000 (21:58 +0100)]
* tests/misc/pwd-long: Work properly even when run from the
wrong one of two or more bind-mounted sibling directories.
Suggestion from Mike Stone in <http://bugs.debian.org/380552>.

17 years agoStandardize on list of signals when an app catches signals.
Paul Eggert [Sat, 20 Jan 2007 08:54:20 +0000 (09:54 +0100)]
Standardize on list of signals when an app catches signals.
* src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ.
* src/ls.c (main): Likewise (except SIGPIPE was already caught).
Note that ls.c is special, as it also catches SIGTSTP.
* src/sort.c (main): Likewise.  Also catch SIGQUIT.  More details in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9510>.

17 years ago[lib/ChangeLog]
Jim Meyering [Fri, 19 Jan 2007 22:28:03 +0000 (23:28 +0100)]
[lib/ChangeLog]
* .cvsignore, .gitignore: Add sys, as well as more
bootstrap-inserted file names.
[m4/ChangeLog]
* .cvsignore, .gitignore: Add more bootstrap-inserted file names.

17 years ago* src/sort.c (cleanup): Clear temphead at the end.
Dan Hipschman [Fri, 19 Jan 2007 22:03:18 +0000 (23:03 +0100)]
* src/sort.c (cleanup): Clear temphead at the end.
(exit_cleanup): New function.
(main): Don't invoke atexit until we're ready.
Invoke it with exit_cleanup, not with cleanup and close_stdout,
to avoid a race condition with cleanup and signal handling.  More
details: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9508

17 years ago* coreutils.texi (ls: General output formatting): Mention the
Jim Meyering [Fri, 19 Jan 2007 11:10:04 +0000 (12:10 +0100)]
* coreutils.texi (ls: General output formatting): Mention the
workarounds to accommodate the Apple Terminal bug.

17 years ago* src/c99-to-c89.diff: Adjust remove.c offsets.
Jim Meyering [Thu, 18 Jan 2007 09:18:02 +0000 (10:18 +0100)]
* src/c99-to-c89.diff: Adjust remove.c offsets.

17 years agoMake "rm --interactive=never ..." never prompt.
Jim Meyering [Wed, 17 Jan 2007 16:02:40 +0000 (17:02 +0100)]
Make "rm --interactive=never ..." never prompt.
* NEWS: Mention this.
* src/remove.h (enum rm_interactive): New ternary type.
(struct rm_options) [interactive]: Use it, here -- rather than bool.
* src/remove.c (prompt): Reflect type change.
* src/mv.c (rm_option_init): Initialize to RMI_NEVER now.
* src/rm.c (main): Add a FIXME comment for '-d' option.
Adapt to type change of rm_options.interactive.

* tests/rm/i-never: New file.  Test for the above fix.
* tests/rm/Makefile.am (TESTS): Add i-never.

17 years ago* bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
Jim Meyering [Mon, 15 Jan 2007 10:31:51 +0000 (11:31 +0100)]
* bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
emit foo.h, for each foo_.h.  This yields one false-positive, fts.h,
but that's ok, since fts_.h will eventually be renamed.

17 years ago* src/remove.c (remove_dir): Don't use errno in diagnostic.
Jim Meyering [Mon, 15 Jan 2007 09:39:32 +0000 (10:39 +0100)]
* src/remove.c (remove_dir): Don't use errno in diagnostic.
Root-only test failure reported by Alex van Hout and Jon Grosshart in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9415/focus=9415>.

17 years ago* bootstrap.conf (avoided_gnulib_modules): Fix my typo:
Jim Meyering [Mon, 15 Jan 2007 09:32:09 +0000 (10:32 +0100)]
* bootstrap.conf (avoided_gnulib_modules): Fix my typo:
s/--avoid=canonicalize-lgpl/--avoid=canonicalize-gpl/

17 years ago* fchdir-stub.c: Remove file. No longer needed.
Jim Meyering [Sun, 14 Jan 2007 16:18:51 +0000 (17:18 +0100)]
* fchdir-stub.c: Remove file.  No longer needed.

17 years agoEnable use of gnulib's new fchdir module.
Bruno Haible [Sun, 14 Jan 2007 16:15:49 +0000 (17:15 +0100)]
Enable use of gnulib's new fchdir module.
* bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl,
since we use canonicalize.
(gnulib_modules): Add fchdir.
* m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub.

17 years agoPut CU_TEST_NAME in the environment for each test run by "make check".
Jim Meyering [Sat, 13 Jan 2007 10:32:19 +0000 (11:32 +0100)]
Put CU_TEST_NAME in the environment for each test run by "make check".

* Transform all Makefile.am files so that when running "make check",
CU_TEST_NAME is set to the name of the test.  This is so that when I
run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check"
on the entire package it is more convenient to map a leak or error
found in a valgrind log file back to the offending test.
Use this command:
(echo tests/Makefile.am.in; find tests -name Makefile.am) \
 |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \
   -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'

17 years agoRegenerate .cvsignore and .gitignore files.
Jim Meyering [Sat, 13 Jan 2007 10:22:01 +0000 (11:22 +0100)]
Regenerate .cvsignore and .gitignore files.

17 years agoAvoid a leak in expr's implementation of the ":" (match) operator.
Jim Meyering [Thu, 11 Jan 2007 18:31:27 +0000 (19:31 +0100)]
Avoid a leak in expr's implementation of the ":" (match) operator.
* src/expr.c (docolon): Free the regexp buffer using regfree, rather
than doing it manually, being careful to set fastmap to NULL first.
Free any re_regs.start and .end members, if necessary.

17 years ago* tests/misc/test-diag: Work also when libc's error function
Jim Meyering [Thu, 11 Jan 2007 17:59:24 +0000 (18:59 +0100)]
* tests/misc/test-diag: Work also when libc's error function
reports the entire program name ("../../src/test"), rather than
just the final component.

17 years agoMerge branch 'master' of /cu
Jim Meyering [Thu, 11 Jan 2007 13:50:09 +0000 (14:50 +0100)]
Merge branch 'master' of /cu

17 years agotrivial merge
Jim Meyering [Thu, 11 Jan 2007 13:49:19 +0000 (14:49 +0100)]
trivial merge

17 years agoDon't use fts_statp uninitialized for "chown -RLh --preserve-root ...".
Jim Meyering [Wed, 10 Jan 2007 21:00:44 +0000 (22:00 +0100)]
Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...".
* src/chown-core.c (FTSENT_IS_DIRECTORY): New macro.
(change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a
directory.  Non-directory entries lack fts_statp data when using
the FTS_NOSTAT option.

17 years ago* tests/sample-test: Update copyright date to 2007.
Jim Meyering [Sun, 7 Jan 2007 17:38:56 +0000 (18:38 +0100)]
* tests/sample-test: Update copyright date to 2007.
* Makefile.maint (copyright-check): Also check the copyright date
in tests/sample-test.

17 years ago* tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
Jim Meyering [Sat, 6 Jan 2007 09:42:17 +0000 (10:42 +0100)]
* tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
based on examples from G.P. Halkes in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9388>.

17 years ago* src/fmt.c (copy_rest): Correct prefix handling.
G.P. Halkes [Sat, 6 Jan 2007 08:49:47 +0000 (09:49 +0100)]
* src/fmt.c (copy_rest): Correct prefix handling.
Don't elide a line with the prefix followed by only white space.
(get_line): Move EOF-check to loop-termination condition.
* tests/fmt/basic (pfx-1): Adjust test to expect desired result.
(pfx-2): Remove test; its premise was contrary to the documentation.

17 years agoAvoid a used-uninitialized bug for invalid input, i.e., when the size
Jim Meyering [Fri, 5 Jan 2007 11:30:51 +0000 (12:30 +0100)]
Avoid a used-uninitialized bug for invalid input, i.e., when the size
of the input, not counting newlines, is 1 % 4.
* gl/lib/base64.c (base64_decode): Don't hard-code inlen==4.
It may be smaller when flushing.

17 years ago* src/dircolors.hin: Add a TERM directive for cons25.
Mike Frysinger [Fri, 5 Jan 2007 08:52:10 +0000 (09:52 +0100)]
* src/dircolors.hin: Add a TERM directive for cons25.

17 years agoUse the release year, not the current year.
Jim Meyering [Thu, 4 Jan 2007 14:34:29 +0000 (15:34 +0100)]
Use the release year, not the current year.
* src/groups.sh (version): Use a better name: @RELEASE_YEAR@.
* src/Makefile.am (RELEASE_YEAR): Define it.
(.sh): Use it.
Thanks to a prod from Eric Blake.

17 years agoEnsure that "group --version" always prints the current year.
Jim Meyering [Thu, 4 Jan 2007 13:55:42 +0000 (14:55 +0100)]
Ensure that "group --version" always prints the current year.
* src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006.
* src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@.
Suggestion from Eric Blake.

17 years ago* Makefile.cfg (local-checks-to-skip): Skip strftime-check, in
Jim Meyering [Thu, 4 Jan 2007 11:08:36 +0000 (12:08 +0100)]
* Makefile.cfg (local-checks-to-skip): Skip strftime-check, in
case you don't have convenient access to glibc info documentation.

17 years ago.cvsignore, .gitignore: Add fchownat.c and wctype-related files.
Jim Meyering [Thu, 4 Jan 2007 11:01:48 +0000 (12:01 +0100)]
.cvsignore, .gitignore: Add fchownat.c and wctype-related files.

17 years ago[ChangeLog]
Jim Meyering [Thu, 4 Jan 2007 10:52:52 +0000 (11:52 +0100)]
[ChangeLog]
When decoding, always allow newlines in input, with almost no
performance impact.
* src/base64.c (do_decode): Initialize decode context.
Call base64_decode one more time, after all input is processed.
(usage): When decoding, newlines are always accepted.

* tests/misc/base64: Add a bunch of tests, for the above.
* gl/lib/base64.c: Include <string.h>.
(base64_decode_ctx_init, get_4, decode_4): New functions.
(base64_decode): Efficiently handle interspersed newlines.
(base64_decode_alloc): Update signature.
* gl/lib/base64.h (struct base64_decode_context): Define.
(base64_decode_ctx_init): Add prototype.
(base64_decode, base64_decode_alloc): Update prototypes.
[doc/ChangeLog]
* coreutils.texi (base64 invocation): When decoding, newlines
are always accepted.

17 years ago* gl/lib/base64.c: Copied from gnulib.
Jim Meyering [Thu, 4 Jan 2007 10:36:54 +0000 (11:36 +0100)]
* gl/lib/base64.c: Copied from gnulib.
* gl/lib/base64.h: Likewise.

17 years ago[oops] Document what the ".0" in e.g., "-k 2,3.0" means, and...
Evan Hunt [Wed, 3 Jan 2007 11:24:35 +0000 (12:24 +0100)]
[oops] Document what the ".0" in e.g., "-k 2,3.0" means, and...
* coreutils.texi (sort invocation): ... that it can be applied to the
field-end spec, but not the field-start one.  Patch from Evan Hunt.

Signed-off-by: Jim Meyering <jim@meyering.net>
17 years agoDocument what the ".0" in e.g., "-k 2,3.0" means, and...
Evan Hunt [Wed, 3 Jan 2007 11:04:24 +0000 (12:04 +0100)]
Document what the ".0" in e.g., "-k 2,3.0" means, and...
* coreutils.texi (sort invocation): ... that it can be applied to the
field-end spec, but not the field-start one.  Patch from Evan Hunt.

Signed-off-by: Jim Meyering <jim@meyering.net>
17 years agoAvoid spurious test failures on MacOS X 10.3.9, in a German locale.
Bruno Haible [Wed, 3 Jan 2007 09:51:37 +0000 (10:51 +0100)]
Avoid spurious test failures on MacOS X 10.3.9, in a German locale.
* tests/chown/deref: Apply lang-default.
* tests/misc/split-a: Likewise.
* tests/mv/reply-no: Likewise.

Signed-off-by: Jim Meyering <jim@meyering.net>
17 years ago* src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
Bruno Haible [Wed, 3 Jan 2007 09:46:25 +0000 (10:46 +0100)]
* src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
Needed on MacOS X.

Signed-off-by: Jim Meyering <jim@meyering.net>
17 years agoNow, "ls -FRL" always follows symbolic links on Linux.
Paul Eggert [Tue, 2 Jan 2007 06:27:22 +0000 (07:27 +0100)]
Now, "ls -FRL" always follows symbolic links on Linux.
* NEWS: Mention this bug fix.
* src/ls.c (gobble_file): Fix bug reported by
Nobuyuki Tsuchimura in
http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html
where "ls -FRL" didn't follow a symbolic link in some cases on Linux.
* tests/ls/follow-slink: Add a test for this case.

Signed-off-by: Jim Meyering <jim@meyering.net>
17 years ago* tests/rm/fail-eperm: Instead, simply transform the actual output diagnostic.
Jim Meyering [Mon, 1 Jan 2007 09:56:01 +0000 (10:56 +0100)]
* tests/rm/fail-eperm: Instead, simply transform the actual output diagnostic.
Test failure reported by Bob Proulx.

17 years ago* tests/rm/fail-eperm: Revert last change. The PATH=... setting
Jim Meyering [Mon, 1 Jan 2007 08:51:43 +0000 (09:51 +0100)]
* tests/rm/fail-eperm: Revert last change.  The PATH=... setting
is not honored at least on HP-UX 11.23 systems.

17 years ago* bootstrap (gnulib_extra_files): Remove announce-gen.
Jim Meyering [Sat, 30 Dec 2006 21:16:35 +0000 (22:16 +0100)]
* bootstrap (gnulib_extra_files): Remove announce-gen.
* bootstrap.conf (gnulib_modules): Add it here instead, now that
it's a module.

17 years ago* tests/misc/base64: Factor a long, repetitive string.
Jim Meyering [Sat, 30 Dec 2006 16:46:09 +0000 (17:46 +0100)]
* tests/misc/base64: Factor a long, repetitive string.

17 years ago* src/c99-to-c89.diff: Adjust remove.c offsets.
Jim Meyering [Sat, 30 Dec 2006 15:19:26 +0000 (16:19 +0100)]
* src/c99-to-c89.diff: Adjust remove.c offsets.