These improvements were suggested at https://savannah.gnu.org/bugs/?46714.
* find/Makefile.am (check_PROGRAMS): Put oldfind in check_PROGRAMS
instead of noinst_PROGRAMS, so that we don't build it when it is
not needed.
* m4/withfts.m4 (FIND_WITH_FTS): Fix whitespace alignment.
(FIND_WITH_FTS): The WITH_FTS C preprocessor macro and the
accompanying Automake conditional are no longer needed.
* THANKS: Add Mike Frysinger.
* configure.ac: Check for getrlimit function directly rather than the
"sys/resource.h" header file.
* lib/fdleak.c: Include "sys/resource.h" when HAVE_GETRLIMIT is set.
(get_max_fd): s/HAVE_GETRUSAGE/HAVE_GETRLIMIT/.
* Makefile.am (gen-ChangeLog): Replace 8 spaces by a tab to avoid
sc_makefile_TAB_only_indentation failure.
* po/POTFILES.in: Remove some entries to let sc_po_check pass.
While at it, sort the entries.
* find/print.c (do_fprintf): Remove stray semicolon to let
sc_prohibit_double_semicolon pass.
* find/util.c (digest_mode): Likewise.
* bootstrap.conf: Change comment to let sc_prohibit_doubled_word pass.
* build-aux/git-log-fix: Remove empty lines at EOF to let
sc_prohibit_empty_lines_at_EOF pass.
* find/testsuite/Makefile.am: Likewise.
* find/testsuite/sv-34079.sh: Likewise.
* find/testsuite/test_inode.sh: Likewise.
* locate/testsuite/locate.gnu/slocate.exp: Likewise.
* lib/buildcmd.c: Remove unused include of openat header to let
sc_prohibit_openat_without_use pass.
* lib/listfile.c: Likewise.
* find/util.c: Remove unused include of 'verify.h' to let
sc_prohibit_verify_without_use pass.
* xargs/xargs.c: Likewise.
* find/parser.c (insert_regex): Mark error diagnostic for translation;
found by 'make sc_unmarked_diagnostics'.
* cfg.mk (exclude_file_name_regexp--sc_prohibit_strncpy): Exempt the
2 remaining sources using the possibly dangerous strncpy function
from the syntax-check.
* find/Makefile.am (oldfind_SOURCES): rename find.c to oldfind.c.
* find/.gitignore: Likewise.
* po/POTFILES.in: rename find/find.c to find/oldfind.c
* find/defs.h: Change references to find.c to oldfind.c.
* doc/find-maint.texi (Factor Out Repeated Code): Likewise.
* find/ftsfind.c: Point out that this file is derived from
oldfind.c (instead of leaving a reference to the old name of the
renamed file).
* find/testsuite/config/unix.exp: Look for ftsfind.o instead of find.o
when checking that we're really looking at the build directory.
This fulfills a reqeust made as Savannah bug #46714.
* NEWS: Mention this change.
* m4/withfts.m4 (FIND_WITH_FTS): --with-fts is the only supported
choice. The configure script now fails if run using --without-fts
or --with-fts=no.
* find/Makefile.am (noinst_PROGRAMS): Never install oldfind.
Delete the oldfind.1 and ftsfind.1 manpages, leaving only find.1.
Fix a typo and remove some commented-out lines.
* find/find.c (main): add a comment pointing out that this is not
the main() function of th binary that actually gets installed.
* find/ftsfind.1: delete.
* find/oldfind.1: delete.
* find/find.1: Remove the section "BINARIES" since there are no
longer two binaries.
* find/testsuite/config/unix.exp: Assume --with-fts; hence the binaries
are always called oldfind and find (and there is no ftsfind binary).
* README-hacking (footer): use the official FDL license wording as
listed in FDL's "ADDENDUM: How to use this License for your
documents". Update copyright year.
* NEWS (footer): Likewise.
* doc/find-maint.texi: Likewise.
* doc/find.texi: Likewise.
* doc/regexprops.texi: Likewise.
* lib/regexprops.c (copying): Amend the code to emit the updated
wording. Update the copyright year.
* find/parser.c (parse_table): -warn is now parsed as a positional
option instead of a global one. This does not affect the effect of
-warn. (found_parser): Warnings are no longer issued for global
options specified in confusing positions when the POSIXLY_CORRECT
environment variable is set. POSIXLY_CORRECT also suppresses warnings
about -d and the use of '/' in the argument to -name. * find/find.1:
Eliminate the duplicate section name OPTIONS, using the OPTIONS
section just for -L, -P and so on. Other options are now documented
in the subsection POSITIONAL OPTIONS (if they take effect only on
items on the command line which appear later) or GLOBAL OPTIONS (if
they take effect even on tests/actions appearing before them). The
-regextype option in particular is now correctly documented as being
positional. We rename the EXPRESSIONS section to EXPRESSION in order
to match the usage summary. The OPERATORS heading is demoted to a
subheading so that it fits within EXPRESSION. (POSITIONAL OPTIONS):
be more explicit about how warnings are controlled by -warn, -nowarn
and POSIXLY_CORRECT. * NEWS: Describe the changes to the find manual
page and warnings.
* xargs/xargs.c (fopen_cloexec_for_read_only): when fdopen fails,
close the file descriptor instead of leaking it. Also, use GNU-style
brace positioning. Both problems were noticed by Paul Eggert.
This fixes a bug reported by Kyle Sallee (by email, so there is no
Savannah bug number for it).
* xargs/xargs.c (fopen_cloexec_for_read_only): New function; like
fopen (..., "r") but sets the resulting file to be closed on exec.
(main): Remember any non-O_CLOEXEC file desciptors that were open
on startup so that we don't get false positives later.
(prep_child_for_exec): Call complain_about_leaky_fds.
(main): Any file opened to support the -a option is marked
close-on-exec. If we open /dev/tty to support the -p option, mark
that file close-on-exec, too.
* NEWS: mention this bugfix.
Before this change, a pointer to struct saved_cwd was used in place
of char*, leading to incorrect error diagnostics, e.g.:
$ chmod a-x . && find / -maxdepth 0 -exec true \;
find: Failed to change directory: ÿÿÿÿ: Permission denied
find: failed to restore initial working directory: ÿÿÿÿ: Permission denied
* find/exec.c (prep_child_for_exec): Fix error diagnostics.
* find/util.c (record_initial_cwd, cleanup_initial_cwd): Likewise.
This fixes Savannah bug #46715 ("testsuite error with perl 5.22,
gnulib outdated").
* doc/regexprops.texi: Regenerate this file from gnulib's changed
regular expression dialect definitions regex.h. The effect is for
regex types egrep and posix-egrep to become synonyms.
* NEWS: Mention this change.
* build-aux/git-log-fix: Re-format the log messages from the last
few commits in order to end up with nicely-formatted ChangeLog
entries, and remove the ChangeLog entries which would otherwise
have reflected the git changes needed to make the corrections.
* doc/find.texi (Run Commands): Add a new subsection and menu
item, Child Exit Status.
(Child Exit Status): New subsection, describing how the exit
status of find is affected (or not) by the exit status of the
commands run by -exec and similar actions.
* find/find.1 (-exec): Explain how the exit status of the child
affects (or not) the exit status of find.
(-execdir): Likewise.
(EXIT STATUS): Likewise.
* NEWS: mention these changes.
* doc/find.texi (Run Commands): Add a new subsection and menu
item, Child Exit Status.
(Child Exit Status): New subsection, describing how the exit
status of find is affected (or not) by the exit status of the
commands run by -exec and similar actions.
* find/find.1 (-exec): Explain how the exit status of the child
affects (or not) the exit status of find.
(-execdir): Likewise.
(EXIT STATUS): Likewise.
* NEWS: mention these changes.
* locate/locatedb.5: Use troff symbols where appropriate,
including \(+- and \(en. Also use - instead of \- when we're not
describing an option.
* NEWS: Mention this change.
* doc/find.texi (Symbolic Links): Explain that -L can give
surprising behaviour when symbolic links can become broken during
the execution of find.
* find/find.1 (-L): Likewise.
* lib/listfile.c (list_file): For aligned fields, use the number
of characters output to deduce whether our current idea of the
maximum width of each field is too small. When this happens,
increase the field width. Keep track of the field width in a
static variable for each field. Do this for the inode number,
number of blocks, owner, group, major and minor device numbers,
and the file size. Use mbswidth in some places to count
characters.
* find/print.c (do_fprintf): Mention the potential portability
problems in casting ino_t to uintmax_t.
* bootstrap.conf (gnulib_modules): Add mbswidth.
* po/Makevars (XGETTEXT_OPTIONS): updated by running bootstrap.
*NEWS: Mention this bugfix.