Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#889 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@SichenLiang ci sta già lavorando.

Dal 4/10/2026.

  • #894 di @SichenLiang — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
651
Fork
111
Merge medio
1g 13h
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di uutils/findutils

Tutte le issue di uutils/findutils

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.