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

Đang mở
#16,735 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Xnadir đang làm issue này rồi.

Từ ngày 20/11/2026.

  • #16736 của @Xnadir — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
24.4k
Fork
2.2k
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
402

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của uutils/coreutils

Tất cả issue của uutils/coreutils

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.