Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#889 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@SichenLiang ya está trabajando en esto.

Desde el 4/10/2026.

  • #894 de @SichenLiang — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
651
Forks
111
Merge medio
1 d 13 h
PR fusionados (30 d)
21

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de uutils/findutils

Todos los issues de uutils/findutils

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.