2659 Commits

Author SHA1 Message Date
Bernhard Voelker
97b8920482 doc: fix the "Finding the Shallowest Instance" example in find.1
* find/find.1 (EXAMPLES): Fix the Pruning SCM example by changing the
attribution of the list from "Sample output" to "Sample directories".
The wrong attribution was made in commit v4.7.0-76-g9302afb9.
Then, add the output for clarity.

Fixes https://sv.gnu.org/bugs/?62259
2025-04-18 13:00:07 +02:00
raf
45530ee875 doc: fix the "Finding the Shallowest Instance" example in Texinfo manual
* doc/find.texi (Finding the Shallowest Instance): Add surrounding \(
and \) around the 3x -exec actions to correctly group them with higher
priority than the implicit '-a' for the following '-print'.  Otherwise,
only the SCM roots matching the last test, "CVS", would be printed.
Improve indentation of the multi-line command.
Add sample output for clarity.
While at it, fix a minor typo.

This bug was present since adding that example in 2008.
The very same issue was already fixed for the man page in commit
v4.6.0-55-g47d8fd38.

Fixes https://sv.gnu.org/bugs/?62259
2025-04-18 12:56:23 +02:00
Bernhard Voelker
ee500667d4 tests: add case for passing -files0-from multiple times
Passing -files0-from several times silently overrides the previously given
file names, and only takes the last one.  This behavior is quite common
and has precedence e.g. in 'du --files0-from ...'.
Add a test to document the current behavior.

* tests/find/files0-from.sh: Add a test passing -files0-from 3 times.

Discussed at:
  https://sv.gnu.org/bugs/?66965
2025-04-06 16:49:12 +02:00
Bernhard Voelker
8e1331d8a7 NEWS: document the previous fixes in find.1
* NEWS (Documentation Changes): Mention the change of the previous commit.
2025-03-25 22:40:37 +01:00
Bjarni Ingi Gislason
2be6812e01 find.1: some remarks and editing fixes in the man page
Reported at:
  https://lists.gnu.org/r/bug-findutils/2025-03/msg00002.html

Output from "mandoc -T lint  find.1": (shortened list)

      1 input text line longer than 80 bytes: Some of the conversi...
      1 missing date, using "": TH
      1 unterminated quoted argument

-.-.

Output from "test-nroff -mandoc -t -ww -z find.1": (shortened list)

      1 	Use macro '.B' for one argument or split argument.
      1 	Use macro '.I' for one argument or split argument.
      1 .BR is for at least 2 arguments, got 1
      1 .IR is for at least 2 arguments, got 1

-.-.

Change a HYPHEN-MINUS (code 0x2D) to a minus(-dash) (\-),
if it
is in front of a name for an option,
is a symbol for standard input,
is a single character used to indicate an option,
or is in the NAME section (man-pages(7)).
N.B. - (0x2D), processed as a UTF-8 file, is changed to a hyphen
(0x2010, groff \[u2010] or \[hy]) in the output.

73:until an expression argument comes (which also starts with a `-').
74:Now, if a path argument would start with a `-', then
875:An exception to this is when using only a slash as \fIpattern\fR (`-name /'),
878:A warning is issued if you try to pass a pattern containing a - but not
879:consisting solely of one - slash, unless the environment variable
1095:The + and - prefixes signify greater than and less than, as usual;
1832:find / -name needle -print -quit
2252:.SS Safer `find -print0 | xargs -0` approach
2324:.SS Traversing the filesystem just once - for 2 different actions
2473:Pruning - omitting files and subdirectories
2590:.B $ find / -name needle -print -quit
2607:.B $ find . .. / /tmp /tmp/TRACE compile compile/64/tests/find -maxdepth 0 -printf '[%h][%f]\en'
2654:.B find -print0
2656:.B xargs -0
2743:find: possible unquoted pattern after predicate `-name'?

-.-.

Add a "\&" (or a comma (Oxford comma)) after "e.g." and "i.e.",
or use English words
(man-pages(7)).
Abbreviation points should be marked as such and protected against being
interpreted as an end of sentence, if they are not, and that independent
of the current place on the line.

546:and e.g. from a pipe.
565:The processing of the starting points is otherwise as usual, e.g.

-.-.

Wrong distance (not two spaces) between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

E-mail: Easier to quote exactly the relevant lines.

Generally: Easier to edit the sentence.

Patches: Less unaffected text.

Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.

  The amount of space between sentences in the output can then be
controlled with the ".ss" request.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

Split (sometimes) lines after a punctuation mark; before a conjunction.

  Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.

Use

sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\.  */\1.\n/g' $1

to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"

[List of affected lines removed.]

-.-.

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Add "\:" to split the string for the output, "\<newline>" in the source.

Line 1546, length 86

Some of the conversion specification characters might not be available on all systems,

Line 2487, length 82

.B $ find . \-name .snapshot \-prune \-o \e( \e! \-name \(aq*~\(aq \-print0 \e) \e

Line 2607, length 96

.B $ find . .. / /tmp /tmp/TRACE compile compile/64/tests/find -maxdepth 0 -printf '[%h][%f]\en'

Line 2645, length 87

.I A Research UNIX Reader: Annotated Excerpts from the Programmer’s Manual, 1971-1986

-.-.

Use \(en (en-dash) for a dash at the beginning (end) of a line,
or between space characters,
not a minus (\-) or a hyphen (-), except in the NAME section.

find.1:2324:.SS Traversing the filesystem just once - for 2 different actions
find.1:2473:Pruning - omitting files and subdirectories

-.-.

Remove reverse slash (\) in front of a period (.) that is to be printed
as such, and can not come a control character in the first column of a line.
Use "\&" to protect the period to avoid that.
This is a sign, that the man page was transformed from another source
file with a program, whose name is NOT mentioned in a comment.

2715:\.B \-perm +MODE
2717:\.B \-perm

-.-.

Split a punctuation mark from a single argument for a two-font macro

1048:.IR ./fubar3,

-.-.

Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".

[List of affected lines removed.]

-.-.

One space only after an end of sentence.

find.1:339:no error message will be issued. This is the reason why such operation
find.1:546:and e.g. from a pipe.
find.1:960:find . \-path \(dq./sr*sc\(dq
find.1:1797:find . \-path ./src/emacs \-prune \-o \-print
find.1:1896:.B find . \-name afile \-o \-name bfile \-print
find.1:2309:.B $ find . \-type f \-exec file \(aq{}\(aq \e;
find.1:2384:.B $ find . \-perm 664
find.1:2399:.B $ find . \-perm \-664
find.1:2413:.B $ find . \-perm /222
find.1:2423:.B $ find . \-perm /220
find.1:2424:.B $ find . \-perm /u+w,g+w
find.1:2425:.B $ find . \-perm /u=w,g=w
find.1:2440:.B $ find . \-perm \-220
find.1:2441:.B $ find . \-perm \-g+w,u+w
find.1:2452:.B $ find . \-perm \-444 \-perm /222 \e! \-perm /111
find.1:2453:.B $ find . \-perm \-a+r \-perm /a+w \e! \-perm /a+x
find.1:2467:.RB ( "! \-perm /111"
find.1:2469:.B ! \-perm /a+x
find.1:2487:.B $ find . \-name .snapshot \-prune \-o \e( \e! \-name \(aq*~\(aq \-print0 \e) \e
find.1:2607:.B $ find . .. / /tmp /tmp/TRACE compile compile/64/tests/find -maxdepth 0 -printf '[%h][%f]\en'
find.1:2727:.B find . \-name afile \-o \-name bfile \-print
find.1:2731:.BR "find . \-name afile \-o \e( \-name bfile \-a \-print \e)" .
find.1:2741:.B $ find . \-name *.c \-print
find.1:2754:.B find . \-name frcode.c locate.c word_io.c \-print
find.1:2766:.B $ find . \-name \(aq*.c\(aq \-print
find.1:2767:.B $ find . \-name \e*.c \-print

-.-.

Put a subordinate sentence (after a comma) on a new line.

[List of affected lines removed.]

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

find.1:638:.IP "\-noleaf"
find.1:1154:.IP "\-writable"
find.1:1196:.IP "\-delete\fR"
find.1:1802:.IP "\-quit"
find.1:2233:.SH "EXAMPLES"
find.1:2638:.SH "HISTORY"
find.1:2659:.SH "COMPATIBILITY"
find.1:2724:.SH "NON-BUGS"
find.1:2770:.SH "BUGS"

-.-.

Section headings (.SH and .SS) do not need quoting their arguments.

1968:.SH "STANDARDS CONFORMANCE"
2120:.SH "ENVIRONMENT VARIABLES"
2233:.SH "EXAMPLES"
2638:.SH "HISTORY"
2659:.SH "COMPATIBILITY"
2724:.SH "NON-BUGS"
2770:.SH "BUGS"
2788:.SH "REPORTING BUGS"
2811:.SH "SEE ALSO"

-.-.

Space after an end of sentence.

temp.table:25:\-exec ... +	4.2.12	POSIX

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

an.tmac:<stdin>:2: style: .TH missing third argument; consider document modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:<stdin>:2: style: .TH missing fourth argument; consider package/project name and version (e.g., "groff 1.23.0")
an.tmac:<stdin>:690: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:1048: misuse, warning: .IR is for at least 2 arguments, got 1
	Use macro '.I' for one argument or split argument.

-.-.

Additionally:

  Change "1\ KB" to "1\ KiB"

  Change indent "4m" to "4n".  "4m" is too wide in troff-mode.

  Inhibit hyphenation of "strftime" once (based on an A4 page size).

  Create a "space" between some tags and the its following text by adding
" \&" to the tag.

  Decrease indent after a bullet in lists.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.

* find/find.1: Change as described above.
2025-03-25 21:57:29 +01:00
Bernhard Voelker
f3a3833320 maint: remove declared-only find_pred_name
Only user was inside a an #ifdef DEBUG / #endif block.
Introduced with -context in commit v4.5.5-42-g1a05af6a.

* find/parser.c (parse_context): Remove #ifdef/#endif block.
* find/defs.h (find_pred_name): Remove declaration.
2025-03-25 20:12:40 +01:00
Bernhard Voelker
dc3365628e find: issue a warning for wrongly accepted operators like '-!'
In the current implementation, GNU find accepts the operators '!', ',',
'(' and ')' with a leading dash, e.g. '-!'.
Let's issue a warning to see if anyone relies on that odd behavior.
With a later release, let's fix the parser, and not accept these anymore.

* find/parser.c (find_parser): Issue a warning in the case one of the
above operators has been passed with a leading '-'.
* tests/find/operators-wrong-with-dash.sh: Add test.
* tests/local.mk (sh_tests): Reference it.
* NEWS (Changes in find): Mention the change in behavior.

Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-03/msg00005.html
2025-03-23 23:47:15 +01:00
Collin Funk
faa1301368 tests: adjust shell syntax that breaks AIX /bin/sh
* find/testsuite/find.gnu/execdir-multiple.exp: Move the 'do' of a for
loop to the same line so AIX doesn't fail.
2025-01-26 18:18:57 +01:00
Bernhard Voelker
e5d6eb919b find: avoid crash when diagnosing a file system loop
When gnulib's FTS returns FTS_DC indicating a directory cycle, then the
struct member 'fts_cycle' is not guaranteed to contain valid data.
Avoid dereferencing it when diagnosing the file system loop.

* find/ftsfind.c (issue_loop_warning): Change the error message to avoid
mentioning the other entry involved in the loop anymore.
(partial_quotearg_n): Remove now-unused function.
* NEWS (Bug Fixes): Mention the fix.

Reported by Dietmar Hahn in
<https://lists.gnu.org/r/bug-findutils/2025-01/msg00013.html>
2025-01-26 18:17:10 +01:00
Bernhard Voelker
d44172075a pred.c: consolidate numerical comparisons
Several predicate tests perform a numerical comparison based on the
comparison_type (COMP_GT, COMP_LT, COMP_EQ).
Factor that out into a utility function.

* find/pred.c (compare_num): Add static function.
(pred_gid, pred_inum, pred_links, pred_size, pred_uid): Use it.
2025-01-06 21:43:57 +01:00
Bernhard Voelker
0c20228608 xargs: clarify command as optional in --help output
* xargs/xargs.c (usage): Fix synopsis by wrapping COMMAND in '[...]',
because it is in fact optional.  Also add a sentence that the default
COMMAND is 'echo'.
2025-01-05 22:32:46 +01:00
Bernhard Voelker
85c67e9c3c doc: mention default command of xargs in 'Invoking xargs'
* doc/find.texi (node Invoking xargs): Add sentence about default
command 'echo'.

Reported by <toomas@rosin.ee> in
https://savannah.gnu.org/bugs/?66591
2025-01-05 22:00:00 +01:00
Bernhard Voelker
a465fc58bc maint: silence GCC-14 on utility source getlimits.c
Seen on GCC 14:
  getlimits.c:73:3: warning: stack-based buffer overflow [CWE-121] \
     [-Wanalyzer-out-of-bounds]
     73 |   sprintf (limit + 1, "%" "ju", (uintmax_t) TYPE##_MAX);     \
        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... while limit is defined more than large enough.

* find/getlimits.c: Add pragma for GCC version >= 14.
2025-01-05 21:23:25 +01:00
Bernhard Voelker
b52c6688ff maint: adjust to gnulib module renaming
Since previous gnulib update, './bootstrap' shows deprecation warnings
like the following for several modules:
  Notice from module errno:
    This module is deprecated. Use the module 'errno-h' instead.
Use the newer names instead:
- errno -> errno-h
- inttypes -> inttypes-h
- locale -> locale-h
- math -> math-h
- realloc-gnu -> realloc-posix
- stdarg -> stdarg-h
- stdbool -> bool
- stddef -> stddef-h
- stdint -> stdint-h
- stdio -> stdio-h
- stdlib -> stdlib-h
- string -> string-h
- sys_stat -> sys_stat-h
- sys_time -> sys_time-h
- sys_types -> sys_types-h
- sys_wait -> sys_wait-h
- wchar -> wchar-h

* bootstrap.conf (gnulib_modules): Do the above replacements.
2025-01-05 00:58:10 +01:00
Bernhard Voelker
7752c3da26 xargs: simplify error handling for gnulib's safe_read function
The gnulib/NEWS file states:
  SAFE_READ_ERROR and SAFE_WRITE_ERROR are now
  obsolescent; callers can just check for < 0.

* xargs/xargs.c (xargs_do_exec): Adjust error handling of safe_read
accordingly.
2025-01-04 20:04:15 +01:00
Bernhard Voelker
00e698e1b2 maint: update gnulib to latest
Run 'make update-gnulib-to-latest'; there have been 1127 commits on gnulib
since the last update.

* gnulib: Update to latest.
* bootstrap: Likewise.
* bootstrap-funclib.sh: Likewise.
* cfg.mk (exclude_file_name_regexp--sc_fsf_postal): Add to exempt the
script build-aux/src-sniff.py from this syntax-check.
2025-01-04 19:59:41 +01:00
Bernhard Voelker
f1f6471ae8 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
2025-01-04 11:43:53 +01:00
Christoph Anton Mitterer
a78812c62e doc: state that -execdir prepends the base names with "./"
The '{}' replacement done by the -execdir action prepends each entry,
i.e., the base names, with "./" unless for the root directory "/".

* doc/find.texi (-execdir): Document that behavior.
* find/find.1: Likewise.

Discussed at: https://sv.gnu.org/bugs/?66568

Copyright-paperwork-exempt: Yes
2024-12-24 14:07:30 +01:00
Bernhard Voelker
1da19bdba7 doc: maint: break lines at sentences in a paragraph to change
As the texinfo renderer is caring about proper layout, we can let sentences
start at the beginning of the line, thus making further changes easier
to review.

* doc/find.texi (-execdir): Break lines at the end of sentences.
2024-12-24 13:35:10 +01:00
Bernhard Voelker
00e82f2c15 maint: fix typo in comment
* find/exec.c (impl_pred_exec): Add '-' to 'execdir' example in comment.
2024-12-24 10:30:08 +01:00
Bernhard Voelker
324b5dddc2 maint: pull in gnulib module basename-lgpl
* bootstrap.conf (gnulib_modules): Add 'basename-lgpl', because we're
using the gnulib 'base_name' function.
2024-12-23 21:00:51 +01:00
Bernhard Voelker
aff4e48c11 find: ignore more vanished subdirectories with -ignore_readdir_race
Similar to commit 889d001ab750 which handles vanished files better,
also fix the race for subdirectories (FTS_DNR).

Reproducer:
In average, the following produced 6-10 failures out of 1000 runs:
  $ mkdir testdir
  $ while :; do mkdir testdir/foo; rmdir testdir/foo; done &
  $ for f in $(seq 1000); do \
      find testdir -ignore_readdir_race -ls ; done >/dev/null
  find: 'testdir/foo': No such file or directory
  find: 'testdir/foo': No such file or directory

* find/ftsfind.c (consider_visiting): Return when FTS returned ENOENT
for FTS_DNR, i.e., unreadable directory, with -ignore_readdir_race.
* tests/find/readdir_race.sh: Add test.
* tests/local.mk (sh_tests): Reference it.
* NEWS (Bug Fixes): Amend and improve description of the previous fix.

See also https://savannah.gnu.org/bugs/?45930
2024-12-23 12:59:24 +01:00
Bernhard Voelker
eac8aecaad maint: update further Makefile variables used by Gnulib
Like in the recent commit, also change the following variables to follow
the renaming done in gnulib:
- LIB_SETLOCALE_NULL -> SETLOCALE_NULL_LIB,
- LIB_MBRTOWC -> MBRTOWC_LIB,
- LIB_EACCESS -> EUIDACCESS_LIBGEN.

* find/Makefile.am (LDADD): Change as described above.
* lib/Makefile.am: Likewise.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
2024-12-02 19:54:19 +01:00
Collin Funk
e65a91d2fb maint: update Makefile variables used by Gnulib
* locate/Makefile.am (LDADD): Remove $(LIB_CLOSE) as it is no longer
required per Gnulib NEWS 2009-03-20.
* xargs/Makefile.am (LADD): Likewise.
* find/Makefile.am (LDADD): Likewise. Change $(LIB_EACCESS) to
$(EUIDACCESS_LIBGEN) per Gnulib NEWS 2023-01-07.
2024-12-02 19:54:19 +01:00
Collin Funk
5db475b306 maint: don't use gettimeofday
POSIX marked gettimeofday obsolete in POSIX.1-2017 and removed it in
POSIX.1-2024. Prefer Gnulib functions which use nanosecond resolution if
supported by the operating system.

* bootstrap.conf (gnulib_extra_files): Remove gettimeofday. Add gettime.
* find/util.c (now): Remove function.
(set_option_defaults): Use current_timespec.
* find/Makefile.am (LDADD): Rename $(LIB_CLOCK_GETTIME) to
$(CLOCK_TIME_LIB) per Gnulib NEWS 2023-01-07.
2024-12-02 19:54:19 +01:00
Bernhard Voelker
ea9288c6be doc: fix typo in Texinfo manual
* doc/find.texi (node Leaf Optimisation): s/filssytems/filesystems/
Bug introduced in v4.5.10-9-gb28cc8c4 in 2011.

Reported by <firasuke@gmail.com> in
https://savannah.gnu.org/bugs/?66418
2024-11-10 16:35:17 +01:00
Bernhard Voelker
baab958700 maint: remove unused include from fstype.c
With newer gnulib, the sc_prohibit_always_true_header_tests check
fails with:
  find/fstype.c:30:#if HAVE_MNTENT_H
  maint.mk: do not test the above HAVE_<header>_H symbol(s);
    with the corresponding gnulib module, they are always true
  make: *** [maint.mk:969: sc_prohibit_always_true_header_tests] Error 1

* find/fstype.c (#include <mntent.h>): Remove as it is not actually used.
2024-11-03 21:32:35 +01:00
Bernhard Voelker
744da6ddcc maint: prefer endian.h for byte order conversions
Now that <endian.h> is a part of POSIX 2024 it should become more
portable than <byteswap.h>.

* bootstrap.conf (gnulib_modules): Remove byteswap; add endian.
* locate/word_io.c: Include endian.h instead of byteswap.h.
(decode_value): Use htobe32 instead of bswap_32.
2024-11-03 21:32:30 +01:00
Bernhard Voelker
f4ec39eee0 maint: import tests/init.sh from Gnulib during bootstrap
* bootstrap.conf (bootstrap_post_import_hook): Use gnulib-tool
--copy-file to import tests/init.sh.
* tests/init.sh: Remove file.
* tests/.gitignore (/init.sh): Add entry.
* Makefile.am (update-gnulib-to-latest): Remove handling tests/init.sh.
2024-11-03 21:32:17 +01:00
Bernhard Voelker
d0187016e1 maint: list Gnulib sys_types directly
* bootstrap.conf (gnulib_modules): Add sys_types.
Although it’s already brought in indirectly, findutils code
includes <sys/types.h> directly.
2024-11-03 21:32:08 +01:00
Bernhard Voelker
57fb016b73 maint: add NEWS entry for recent 'find -execdir/-okdir' change
* NEWS (Changes in find): Reflect the change in behavir in recent
commit v4.10.0-15-g1dcdf3de.
2024-11-03 21:14:37 +01:00
Bernhard Voelker
2ef0b4ce38 maint: fix indentation in NEWS
* NEWS: Use 2 char indentation.
2024-11-03 21:09:51 +01:00
Bernhard Voelker
128c5b18c9 maint: make tests/sample-test executable
To avoid that new tests copied from the template sample-test lack the
executable bit, add the executable bit to that file.

* tests/sample-test: Set executable permission bit.
2024-11-03 20:04:48 +01:00
Bernhard Voelker
727d261bb8 maint: make new tests/find/sv-bug-66365-exec.sh executable
'make syntax-check' fails with:
  tests_executable
  maint.mk: Please make test executable: tests/find/sv-bug-66365-exec.sh
  make: *** [cfg.mk:129: sc_tests_executable] Error 1

* tests/find/sv-bug-66365-exec.sh: Set executable permission bit.
2024-11-03 20:04:42 +01:00
James Youngman
1dcdf3de8e find: -exec is terminated by + only if the prior arg is exactly '{}'
A "+" only terminates -exec when it immediately follows an argument
which is exactly "{}" (and not, for example, "{}x").  This fixes
Savannah bug 66365.

* NEWS: explain this change.
* doc/find.texi: update one place which omitted the '{}' before '+'.
* find/parser.c (insert_exec_ok): consider + to be special ony if it
  follows an argument which is exactly '{}'.
* tests/find/sv-bug-66365-exec.sh: test for this bug.
* tests/local.mk: add the new test file.
2024-11-02 18:42:35 +00:00
James Youngman
457acfa06b Fix VPATH compilation failure for 'make check'
The libgnulib.a library isn't (necessarily) below $(top_srcdir), it's
below $(top_builddir).  This fixes a bug introduced in commit
85fc8966e5912390ad220d03b188dd319c85ed1e.
2024-10-31 15:29:07 +00:00
Bernhard Voelker
e38e2f8a36 tests: avoid -Wshadow warning
Seen on GCC 14.2.0:

tests/xargs/test-sigusr.c: In function 'run_xargs':
tests/xargs/test-sigusr.c:159:43: warning: declaration of 'optarg' \
  shadows a global declaration [-Wshadow]
  159 | run_xargs(const char *option, const char *optarg, int send_signal)
      |                               ~~~~~~~~~~~~^~~~~~
  ...
  /usr/include/bits/getopt_core.h:36:14: note: shadowed declaration is here
   36 | extern char *optarg;
      |              ^~~~~~

* tests/xargs/test-sigusr.c (run_xargs): Rename 'optarg' parameter
to 'opt_arg'.
2024-09-17 22:46:58 +02:00
Bernhard Voelker
523043b313 maint: avoid using FSF postal address
The postal address of the FSF has changed from Franklin Street to
Milk Street in Boston, yet according to RMS we shall better avoid
the postal address.

* build-aux/update-online-manual.sh (Copyright): Change from postal
address to the FSF URL.
2024-09-17 21:50:11 +02:00
Bernhard Voelker
f65a2a960f maint: adjust to Gnulib -Wsystem-headers change
* configure.ac: Don’t suppress -Wsystem-headers since Gnulib no
longer enables it.

Borrowed from
  https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=94e8f2b012eb
2024-09-17 21:49:56 +02:00
Bernhard Voelker
4a719e65d2 maint: pacify GCC 14.2
Avoid the following warnings:
tree.c:1573:19: warning: no previous declaration for 'cost_table' [-Wmissing-variable-declarations]
 1573 | struct cost_assoc cost_table[] =
      |                   ^~~~~~~~~~
findutils-version.c:37:13: warning: no previous declaration for 'version_string' [-Wmissing-variable-declarations]
   37 | const char *version_string = VERSION;
      |             ^~~~~~~~~~~~~~

* find/tree.c (cost_table): Declare static.
* lib/findutils-version.c (version_string): Likewise.
* locate/frcode.c (version_string): Remove extern declaration.
* locate/locate.c: Likewise.
* xargs/xargs.c: Likewise.
2024-09-17 21:49:18 +02:00
Bernhard Voelker
889d001ab7 find: ignore more vanished entries with -ignore_readdir_race
Reproducer:
  # Spin up lots of short-living processes.
  $ while env true; do sleep .001; done &

  # Invoke 'find' on the /proc file system;
  # this pretty reliably gives the following error:
  $ find /proc -ignore_readdir_race -maxdepth 3 > /dev/null
  find: '/proc/845078': No such file or directory

* find/ftsfind.c (consider_visiting): Return when FTS returned ENOENT
with the option -ignore_readdir_race.
* NEWS (Bug Fixes): Mention the fix.

Fixes https://savannah.gnu.org/bugs/?45930
2024-09-17 21:49:00 +02:00
Dave
07bd7fa675 build: add bison as requirement
Building from git without bison available would result in
  cc1: fatal error: ./parse-datetime.c: No such file or directory
which is not a very helpful error message.
Let gnulib bootstrap check for bison much earlier.

* README-hacking (Prerequisites): Add Bison explicitly.
* bootstrap.conf (buildreq): Add bison.
* cfg.mk (bootstrap-tools): Add gnulib variable with tools including
bison.

Co-authored-by: Bernhard Voelker <mail@bernhard-voelker.de>
Copyright-paperwork-exempt: Yes
2024-09-17 21:44:33 +02:00
Collin Funk
85fc8966e5 tests: link binaries to gnulib
* tests/local.mk (AM_CPPFLAGS): Include gnulib headers.
(LDADD): Link to gnulib.

Copyright-paperwork-exempt: Yes
2024-06-24 14:35:55 +02:00
Bernhard Voelker
b94986a897 doc: avoid sc_prohibit_unhyphenated_eof failure
'make syntax-check' complains:
  maint.mk: use "end-of-file", not "end of file"
  make: *** [cfg.mk:273: sc_prohibit_unhyphenated_eof] Error 1

* doc/find.texi (xargs options): Change as suggested by the SC rule.
2024-06-24 14:33:09 +02:00
James Youngman
76ddbb913e doc: State that find -print0 and xargs -0 are in POSIX from Issue 8.
The forthcoming Issue 8 of the POSIX standard includes find -print0
and xargs -0.
* doc/find.texi: find -print0 is no longer GNU-specific.  Similarly
for xargs -0.
* xargs/xargs.1: Likewise.
* NEWS: mention these changes.
2024-06-03 12:40:42 +01:00
James Youngman
bb13ef8f93 find: mention when -print0 was introduced.
* find/find.1(COMPATIBILITY): mention that -print0 was introduced in
release 2.0 and is planned for inclusion in POSIX Issue 8.
2024-06-03 12:16:55 +01:00
James Youngman
1c8f85de97 maint: prohibit the use of tabs in Findutils C sources.
This check does not apply to gnulib code.
* cfg.mk (sc_spaces_not_tabs): add syntax check prohibiting
the use of tabs in Findutils code.
* build-aux/tabs-to-spaces.sh: Add small tool for converting
source file tabs to spaces.
2024-06-01 21:41:11 +01:00
James Youngman
e178314ae3 maint: convert tabs to spaces in C source files. 2024-06-01 21:41:05 +01:00
Bernhard Voelker
c8fd333368 maint: post-release administrivia
* NEWS: Add new dummy release header.
2024-06-01 19:19:31 +02:00
Bernhard Voelker
c67264238d version 4.10.0
* NEWS: Record release date.
v4.10.0
2024-06-01 17:04:27 +02:00