Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

xargs: empty items are dropped with -0 and -d

Open
#889 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@SichenLiang is already working on this.

Since Oct 4, 2026.

  • #894 by @SichenLiang — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start by locating the xargs implementation and its handling of -0 and -d byte-delimited input. Reproduce the commands in this report, then trace how delimiters at the beginning or next to another delimiter are parsed. Done means empty items reach the command, including with -n1 and -r, while non-byte-delimited behavior remains unchanged.

Written by the indexing model from the issue text.

Description

With -0 or -d, uutils xargs drops an empty input item when a delimiter appears at the start of the input or immediately after another delimiter.

$ printf 'a\0\0b\0' | xargs -0 printf '[%s]\n'
[a]
[b]

GNU findutils 4.11.0 passes the empty item to the command:

[a]
[]
[b]

The same problem occurs with explicit delimiters, including:

printf 'a,,b,' | xargs -d, printf '[%s]\n'
printf 'a\n\nb\n' | xargs -d '\n' printf '[%s]\n'

Dropping the item also changes the behavior of options that count arguments. For example, GNU runs test -n '' here and exits 123, while uutils skips that invocation and exits 0:

printf 'a\0\0b\0' | xargs -0 -n1 test -n

Likewise, printf '\0' | xargs -0 -r printf '[%s]\n' prints [] with GNU but runs nothing with uutils.

This is specific to byte-delimited input. Without -0 or -d, empty lines do not become empty arguments.

Tested on Linux x86_64 against GNU findutils 4.11.0.

Dominant language
Rust
Stars
651
Forks
111
Avg merge
1d 13h
Merged PRs (30d)
21

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/findutils

All issues in uutils/findutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.