sort -nu emits an exact duplicate and -nCu accepts it under de_DE.UTF-8

オープン
#16,735 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Xnadir がすでに取り組んでいます。

2026年11月20日 から。

  • #16736 @Xnadir による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
cli

調査の方向性

Start with the float parsing path in src/uu/sort/src/sort.rs around lines 722–729 and the early return around lines 2859–2872, then compare whole-line -n handling with -k1,1n. Reproduce under de_DE.UTF-8 using the commands in the issue and check the pairwise -nCu comparisons. Done when sort -nu omits the duplicate 9 and sort -nCu rejects the input, matching GNU.

索引モデルが issue の本文から書いたものです。

説明

U - sort

In de_DE.UTF-8 these amounts are 9, 100, 1000, and 9.

export LC_ALL=de_DE.UTF-8
amounts() { printf '%s\n' 9 100,0 1.000 9; }
amounts | sort -nu
amounts | sort -nCu
echo "$?"

uutils prints all four lines, including the second 9, and the check exits 0. GNU 9.12 prints only the first three lines and the check exits 1. On the same input, uutils sort -k1,1n -u matches GNU.

Checking each two-line pair separately with -nCu shows the cycle: uutils accepts 9 < 100,0, 100,0 < 1.000, and 1.000 < 9. GNU rejects the last pair.

The whole-line float cache reads 1.000 as 1 when compared with 9. With 100,0 the comma forces the locale-aware path, which reads 1.000 as 1000. This persists after #10339. See float parsing and the early return.

Verified on Linux x86_64 with uutils 0.12.0 and main at 95954130.

主要言語
Rust
スター
24.4k
フォーク
2.2k
平均マージ
2日 23時間
マージ済み PR(30日)
402

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uutils/coreutils のほかの issue

uutils/coreutils の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。