xargs: empty items are dropped with -0 and -d
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 651
- フォーク
- 111
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
uutils/findutils のほかの issue
-
-printf %m and -ls drop setuid/setgid/sticky bits and the file type対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
uutils/findutils#692 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
find on Windows: opt in to / as the path separator対応中かも @mutewinter が 7 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
メンテナーはふだん 1 日以内に返信
-
xargs: -x runs a pending command before rejecting an oversized argument対応中かも @SichenLiang が 9 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 28/100
メンテナーはふだん 1 日以内に返信
-
find: -ls shows the time instead of the year for old files対応中かも @SichenLiang が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 32/100
メンテナーはふだん 1 日以内に返信
uutils/findutils の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
area:sim good first issue kind:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信
-
The demo's interval button and chart legend keep the previous interval after an interval changeオープンbug ui
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
userFRM/egui-charts#670 ·
メンテナーはふだん 1 日以内に返信
-
docs good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
Usenova-Labs/usenova-backend#35 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
lugassawan/swe-workbench#823 ·
メンテナーはふだん 1 日以内に返信