diff -e: no script at all when a file has no newline at the end
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
- 35/100
Direzione di ricerca
Read src/ed_diff.rs around lines 65 and 71, where DiffError::MissingNL causes an early return, and inspect the missing_newline test in tests/by-util/test_diff.rs around line 122. Compare diff -e output for files with missing final newlines against GNU diff; done means the ed script is printed and missing-newline warnings match the described behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When either file's last line has no newline, diff -e prints nothing on stdout:
$ printf 'a\nb' > x; printf 'a\nc\n' > y
$ diffutils diff -e x y
No newline at end of file
$ echo $?
2
$ /usr/bin/diff -e x y # GNU diff 3.12
2c
c
.
/usr/bin/diff: x: No newline at end of file
$ echo $?
2
GNU still writes the ed script, then warns on stderr for each file that lacks the final newline (diff: FILE: No newline at end of file, then a blank line) and exits 2. Both exit 2, but a caller that applies the script, or shows it, gets nothing from uutils.
The early return is in src/ed_diff.rs:65 and src/ed_diff.rs:71 (DiffError::MissingNL). The test missing_newline (tests/by-util/test_diff.rs:122) checks for the current stderr (starts_with("No newline at end of file")), so matching GNU means changing that test. I have a change that matches GNU for either file, both, two different files with the same content, an empty file and stdin (apart from 2,2d, which is #308); happy to open a PR if you want GNU's output here.
uutils diffutils main 8ff5bda and v0.6.0.
- Lingua principale
- Rust
- Stelle
- 280
- Fork
- 49
- Merge medio
- 2g 9h
- PR unite (30g)
- 16
Preparare l'ambiente
- 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/diffutils
-
cmp: quiet mode compares full file sizes before applying -nForse già presa @SichenLiang l’ha presa 29 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
diff: `-y --tabsize=<huge>` overflows the column arithmetic (overflow-checks only)Forse già presa @sami-daniel l’ha presa 80 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
diff panics on an oversized inline context count (`-c`/`-u`/`-C`/`-U`): parse overflow and capacity overflowForse già presa @MsfPablo l’ha presa 75 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
uutils/diffutils#245 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
sdiff: fix the layout of unchanged rows, blank lines and cut tabsForse già presa @sami-daniel l’ha presa 26 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 28/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di uutils/diffutils
Issue simili
-
Published SDL drops input-field default values: a non-null field with a default renders as requiredAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
色変記事を追加Apertapriority middle
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
KATO-Hiro/AtCoderClans#12955 ·
I maintainer di solito rispondono entro 1 giorno
-
auto:doc-drift auto:producer
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
fritzprix/libr-agent#2458 ·
I maintainer di solito rispondono entro 1 giorno
-
Flaky test: terminal parity an_exited_shell_says_how reads status before the exit is seenForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
yantrikos/yantrik-os#1048 ·
I maintainer di solito rispondono entro 1 giorno
-
rust
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
vllm-project/vllm#64939 ·
I maintainer di solito rispondono entro 1 giorno