1182 Commits
Author SHA1 Message Date
Coro f5f0f64a33 find: reject a signed -maxdepth/-mindepth value to match GNU
convert_arg_to_number parsed the depth with Rust's usize parser, which accepts a
leading '+', so "-maxdepth +1" was silently accepted. GNU find rejects a signed
value there. Only accept plain decimal digits. Adds a test_find.rs test.
2026-08-19 22:42:41 +02:00
amoghsingh130 1acf40a64b find: handle -fprintf write errors without panicking 2026-08-18 21:15:55 +02:00
Coro e1927ac792 find: avoid panic on a non-UTF-8 argument
std::env::args panics on a non-UTF-8 argument. Read the arguments with args_os
and report the first invalid one with a clean error and exit 1, instead of
aborting (#816). Adds a helper unit test and a test_find.rs test.
2026-08-18 21:15:05 +02:00
Sylvestre Ledru 2a3eac9893 ci: don't count a test that stopped running as an improvement
improvements was "failing in the reference, not failing now", which is
also true of a test that produced no result because it hung. That is how
a hang in find got reported as "+ gnu/okdir_path_empty". List those
separately instead; they don't fail the job, since an upstream rename
looks the same.
2026-08-18 19:20:00 +02:00
Sylvestre Ledru d1580035c1 find: reject -files0-from - combined with -ok/-okdir
The starting points and the answers to the prompts would both be read
from standard input, so they compete for the same bytes and the result
depends on buffering. GNU find rejects the combination up front; we
accepted it and prompted, consuming input meant for the caller. The bfs
tests gnu/files0_from_stdin_ok and gnu/ok_files0_from_stdin now pass, and
the former no longer hangs on the testsuite's stdin.

Reading the starting points from a file leaves stdin free for the
prompts, so that combination stays allowed.
2026-08-18 19:20:00 +02:00
Sylvestre Ledru 1e9679cecc find: refuse -execdir/-okdir when $PATH has a relative entry
Both actions run the command after changing into the directory being
scanned, so a relative $PATH entry -- including the empty string and ".",
which mean the current directory -- would be looked up inside a directory
somebody else may be able to write to. GNU find rejects this at parse
time; we ran the command anyway, and for -okdir we first prompted, which
meant reading the answer from whatever stdin happened to be. In the bfs
testsuite that is the harness's own stdin, so gnu/okdir_path_empty hung
and reported no result at all instead of failing (bfs gnu/okdir_path_*
and gnu/execdir_path_* now pass).

An unset $PATH is left alone: the command is then looked up in the
system default path.
2026-08-18 19:20:00 +02:00
Coro 6e4a7fbe90 find: reject a non-numeric prefix in the -size argument (#834)
The -size argument was parsed with an un-anchored regex, so "x5c" or "abc5c"
silently matched the "5c" in the middle. Anchor the regex and allow only the
one extra '+' GNU accepts after the comparison sign, so "++5c"/"-+5c" stay valid
while the junk-prefix and invalid-sign forms are rejected. Adds a test_find.rs
test.
2026-08-18 12:48:46 +02:00
dependabot[bot] 920f2f0afd build(deps): bump dawidd6/action-download-artifact from 21 to 23
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 21 to 23.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v21...v23)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-version: '23'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-18 08:02:25 +02:00
MsfPablo 9e778f12fc -printf: warn on unrecognized directives/escapes instead of dropping or erroring (#818)
Two divergences from GNU find:

- An unrecognized %X directive silently dropped the '%' and printed
  only the following character.
- An unrecognized \X escape was a hard parse error (exit 1) instead of
  a warning.

Both now print a "find: warning: ..." message to stderr and emit the
directive/escape literally (with its '%' or '\' prefix), matching GNU
find's behavior and exit code (0).

Also fixes advance_one(), which sliced the remaining format string at
a fixed 1-byte offset and panicked on multibyte characters (e.g. '€')
immediately after '%' or '\' — using char::len_utf8() instead.

Fixes #815
2026-08-16 21:10:17 +02:00
MsfPabloandPablo Garcia 906427c159 find: stream -files0-from input instead of slurping it (#831)
-files0-from read the whole input into memory with read_to_end before
splitting on NUL, so an endless source such as /dev/urandom or /dev/zero
exhausted memory and produced no output. Read the starting points
incrementally with read_until(0) and walk each one as it is parsed.

Fixes #779

Co-authored-by: Pablo Garcia <pablito@MacBook-Neo-de-Pablo.local>
2026-08-16 21:01:41 +02:00
Sylvestre Ledru b80c2db112 build: add cargo-binstall metadata (#814)
Point cargo-binstall at the cargo-dist release artifacts
(findutils-{target}.tar.xz, zip on Windows) so 'cargo binstall
findutils' installs prebuilt binaries instead of building from source.
2026-08-16 20:57:56 +02:00
Kevin BurkeandClaude Opus 5 c4fdf2b233 xargs: don't emit an empty argument for a trailing blank (#829)
When input ended with a blank immediately before its final newline,
xargs passed one extra empty argument to the command:

    $ printf 'aaa \nbbb \n' | xargs printf '[%s]'
    [aaa][bbb][]        # was
    [aaa][bbb]          # GNU findutils 4.10.0, and now

WhitespaceDelimitedArgumentReader::next used one `result.is_empty()`
check to answer two different questions. The whitespace branch broke out
of the loop only if `result` was non-empty, so a delimiter seen before
any token was skipped -- correct for blanks, but it left "we are
mid-token" indistinguishable from "we have not started one". The EOF
branch then used `i == 0` as a proxy for "nothing was consumed", which
is false for a final call that consumes only the trailing newline, so it
flushed a zero-length token. Input ending without a newline happened to
work because nothing was left to consume.

Track that state explicitly with an `in_argument` flag, mirroring
`seen_arg` in GNU's read_line, and test `result.is_empty()` at EOF. A
delimiter now ends an argument only when we are inside one, and EOF
flushes only a non-empty buffer.

This also fixes a second symptom of the same conflation: quoted empty
arguments were dropped mid-stream, since quotes start an argument
without contributing any bytes. `printf '"" x\n'` gave [x] and now gives
[][x], again matching GNU. An unterminated `x ''` at end of input still
yields just [x], as GNU's `if (p == linebuf) return -1` does.

-I/-i is unaffected: with a replace string and no explicit delimiter,
xargs uses the newline-delimited reader instead.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 20:57:31 +02:00
✿ Fleur de Blue 7ac06f1df3 fix: make --version output consistent across utilities (#838)
* fix: make --version output consistent across utilities

* Handle `DisplayHelp/DisplayVersion` explicitly

* Add tests
2026-08-16 20:53:19 +02:00
dependabot[bot] aeb8f59730 build(deps): bump ctor from 1.0.12 to 1.0.13
Bumps [ctor](https://github.com/mmastrac/linktime) from 1.0.12 to 1.0.13.
- [Release notes](https://github.com/mmastrac/linktime/releases)
- [Changelog](https://github.com/mmastrac/linktime/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mmastrac/linktime/compare/ctor-1.0.12...ctor-1.0.13)

---
updated-dependencies:
- dependency-name: ctor
  dependency-version: 1.0.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-13 08:07:33 +02:00
dependabot[bot] 5aa8184da6 build(deps): bump thiserror from 2.0.19 to 2.0.20
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.19 to 2.0.20.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.19...2.0.20)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-version: 2.0.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-12 08:04:12 +02:00
xtqqczze 58c3af08a8 chore(cargo): remove deprecated package authors field 2026-08-10 11:10:13 +02:00
dependabot[bot] 73e2f23d81 build(deps): bump uucore from 0.9.0 to 0.10.0
Bumps [uucore](https://github.com/uutils/coreutils) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/uutils/coreutils/releases)
- [Commits](https://github.com/uutils/coreutils/compare/0.9.0...0.10.0)

---
updated-dependencies:
- dependency-name: uucore
  dependency-version: 0.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-10 08:13:22 +02:00
dependabot[bot] 30ae567b76 build(deps): bump CodSpeedHQ/action from 5.0.2 to 5.0.3
Bumps [CodSpeedHQ/action](https://github.com/codspeedhq/action) from 5.0.2 to 5.0.3.
- [Release notes](https://github.com/codspeedhq/action/releases)
- [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codspeedhq/action/compare/v5.0.2...v5.0.3)

---
updated-dependencies:
- dependency-name: CodSpeedHQ/action
  dependency-version: 5.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-10 08:06:48 +02:00
dependabot[bot] fdb1122a8c build(deps): bump clap from 4.6.5 to 4.6.6
Bumps [clap](https://github.com/clap-rs/clap) from 4.6.5 to 4.6.6.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.6.5...clap_complete-v4.6.6)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.6.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-10 08:06:06 +02:00
dependabot[bot] 41157e02ab build(deps): bump uutests from 0.9.0 to 0.10.0
Bumps [uutests](https://github.com/uutils/coreutils) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/uutils/coreutils/releases)
- [Commits](https://github.com/uutils/coreutils/compare/0.9.0...0.10.0)

---
updated-dependencies:
- dependency-name: uutests
  dependency-version: 0.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-10 08:04:59 +02:00
MsfPablo 065320c57d xargs: strip (os error N) from --arg-file open failure (#822)
* xargs: strip `(os error N)` from --arg-file open failure

When --arg-file points at a missing path, xargs used to surface the raw
io::Error display, which appends " (os error N)" for OS errors:

    Error: Failed to open sdf: No such file or directory (os error 2)

GNU xargs omits that detail. Reuse uucore::error::strip_errno (already
used by updatedb) so the message reads:

    Error: Failed to open sdf: No such file or directory

Closes #811

* test: make xargs_arg_file_missing_strips_errno cross-platform

The assertion hardcoded the Unix errno wording ("No such file or
directory"), so the test failed on Windows where the OS reports
"The system cannot find the path specified." (reported by @sylvestre).

The contract this test guards is only that the trailing "(os error N)"
suffix is stripped — the OS wording is out of our control. Assert the
portable parts instead: our "Failed to open <path>:" wrapper names the
path and no "(os error" suffix leaks.
2026-08-09 02:14:41 +02:00
dependabot[bot] 1f19cdd22e build(deps): bump CodSpeedHQ/action from 5.0.1 to 5.0.2
Bumps [CodSpeedHQ/action](https://github.com/codspeedhq/action) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/codspeedhq/action/releases)
- [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codspeedhq/action/compare/v5.0.1...v5.0.2)

---
updated-dependencies:
- dependency-name: CodSpeedHQ/action
  dependency-version: 5.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-05 08:02:53 +02:00
xtqqczze d19ce8b174 build(deps): update rust crates 2026-08-04 09:24:55 +02:00
dependabot[bot] 11b8c4d59b build(deps): bump clap from 4.6.4 to 4.6.5
Bumps [clap](https://github.com/clap-rs/clap) from 4.6.4 to 4.6.5.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.6.4...clap_complete-v4.6.5)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.6.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-04 07:58:06 +02:00
Sylvestre Ledru c8bb10b3de release notes for 0.10.0 2026-08-03 23:51:49 +02:00