sort -nu: a comma after the decimal point can make distinct numbers compare equal
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 62/100
Línea de trabajo
The bug is in NumInfo::parse in src/uucore/src/lib/features/numeric_str_cmp.rs (around lines 131-137), which skips the thousands separator without checking whether a decimal point was already consumed. Reproduce with the two printf | LC_ALL=en_US.UTF-8 sort -nu examples in the issue and compare against GNU sort. Done when 1.2,9 and 1.29,0 both survive -nu, 1.2,9 sorts before 1.21,0 under -n, and 1,200.5 still equals 1200.50.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
In en_US.UTF-8, sort -nu silently drops the second of two records with distinct decimal prefixes. Both implementations exit 0.
printf '%s\n' '1.2,9' '1.29,0' | LC_ALL=en_US.UTF-8 sort -nu
GNU prints both rows. uutils prints only 1.2,9. GNU stops the numeric prefix at the comma after the decimal point. uutils skips it and compares 1.29 with 1.290.
Plain sorting is also affected.
printf '%s\n' '1.2,9' '1.21,0' | LC_ALL=en_US.UTF-8 sort -n
GNU keeps the input order. uutils puts 1.21,0 first. With -t, -k1,1n -u, both retain both rows in the first example. Both correctly treat 1,200.5 and 1200.50 as equal with -nu.
Verified on x86_64 Linux with uutils 0.12.0, 0.13.0 and main at 8b16a3dca86ae91df73db3d375205eb7718c4c03 against GNU 9.7 and 9.12. Unlike #16735, this also reproduces with -k1,1n -u using the default field delimiter. NumInfo::parse skips the thousands separator without checking whether a decimal point has already been consumed. https://github.com/uutils/coreutils/blob/8b16a3dca86ae91df73db3d375205eb7718c4c03/src/uucore/src/lib/features/numeric_str_cmp.rs#L131-L137
- Lenguaje dominante
- Rust
- Estrellas
- 24.4k
- Forks
- 2.2k
- Merge medio
- 2 d 23 h
- PR fusionados (30 d)
- 402
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de uutils/coreutils
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
split -n leaves bytes from a previous run in chunks that should be emptyPosiblemente ocupada @costajohnt la tomó hace 2 días. AbiertoU - split
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
dircolors: '=' is not escaped and '^'/'\\' do not toggle the backslash state, unlike GNUQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. AbiertoU - dircolors
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
Los mantenedores suelen responder en 1 día
-
U - shred
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
chown -v: `+ID` spec echoed verbatim on a broken symlinkPosiblemente ocupada @sunsss123soldier la tomó hace 7 días. Abiertogood first issue oss-scanner U - chown
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
Todos los issues de uutils/coreutils
Issues similares
-
marketing
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
S: Untriaged T: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
libnyanpasu/clash-nyanpasu#6537 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Menos de una hora Aptitud para principiantes 62/100
tauri-apps/tao#1445 ·
Los mantenedores suelen responder en 1 día
-
bug P3
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
-
go good first issue test
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días