nl: section delimiters reset --join-blank-lines grouping
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 74/100
Direzione di ricerca
Il bug si trova in src/uu/nl/src/nl.rs, intorno alle righe 442-448, dove consecutive_empty_lines viene azzerato per ogni riga non vuota prima che venga eseguito il controllo del delimitatore di sezione. Prima compila con cargo build --locked -p uu_nl ed esegui la riproduzione dalla issue per confermare che l'output differisce da quello di GNU. È completato quando il conteggio delle righe vuote viene mantenuto attraverso il delimitatore, corrispondendo all'output atteso, e un caso di regressione è aggiunto ai test di nl.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
With -ba -l2, a section delimiter resets the count of blank lines in uutils. GNU preserves that count across the delimiter. This makes uutils omit a line number and shifts the numbering of subsequent text.
Reproduced on Linux x86_64 (Debian 13), with LC_ALL=C LANG=C, using uutils 0.13.0 built from current main at 43eb6205c20c551480057cdee98e6e7529cd984d. Compared with GNU coreutils 9.12 from the reference package linked in CONTRIBUTING.md; GNU 9.7 gives the same expected result.
Reproduction
From the repository root:
cargo build --locked -p uu_nl
export LC_ALL=C LANG=C
printf '%s\n' '' '\:\:' '' X | target/debug/nl -ba -l2 -w1 -s: | cat -A
The input is a blank line, a body-section delimiter, another blank line, and X. cat -A marks each line ending with $; the spaces below are literal.
Actual output:
$
$
$
1:X$
Expected output, produced by GNU 9.12 and 9.7 with the same arguments:
$
$
1:$
2:X$
Both implementations exit 0 with empty stderr. GNU numbers the second blank line as 1 and the following text as 2; uutils leaves the blank line unnumbered and numbers the text as 1.
Adding -p also reproduces the difference, so this is separate from restarting line numbers at a section boundary. As controls, both implementations agree when the delimiter is removed, or replaced with ordinary text.
Cause
In nl.rs:442–448, consecutive_empty_lines is reset for every nonempty input line before checking whether the line is a section delimiter. The delimiter therefore clears the pending blank-line group.
No matching report was found in searches of open and closed issues and related PRs for nl, blank-line grouping, and section delimiters. #15586 concerns retaining the current section across input files; this reproduction uses a single input stream and still fails after that fix.
- Lingua principale
- Rust
- Stelle
- 24.3k
- Fork
- 2.1k
- Merge medio
- 2g 6h
- PR unite (30g)
- 399
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di uutils/coreutils
-
Unhelpful manual page(s)Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
pr: -n repeats line numbers after a form feedForse già presa @1kailas l’ha presa oggi. ApertaU - pr
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
uniq: overflowing -f/-s/-w values with trailing garbage are silently acceptedForse già presa @huuan26 l’ha presa 1 giorno fa. ApertaU - uniq
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
fold: tab after an 8 KiB buffer flush exceeds the requested widthForse già presa @gibkim l’ha presa 3 giorni fa. ApertaU - fold
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di uutils/coreutils
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
longbridge/gpui-kit#3795 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
saltnpepper97/halley#271 ·
I maintainer di solito rispondono entro 1 giorno
-
Remove the unused gh-aw agentic workflow setupForse già presa @AviAvni l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 3 giorni
-
bug stdlib
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 83/100
Sh1n1230/PunctuationToggle#308 ·
I maintainer di solito rispondono entro 1 giorno