NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: deroff -w and broken input to spell causes misspellings



On Tue, 25 Nov 2025, Jeremy C. Reed wrote:

Today I looked closer and saw that deroff -w was corrupting my non-roff input.

$ jot 1000 | number | grep [a-z] | xargs | tee ~/tmp/long-line | spell
hree
hund
nty
sevent
thi
tw
ty
[...]
Is this a known spell or deroff -w bug causing it to chop my long lines causing misspellings?


This looks like a consequence of using a fixed-size line buffer; then with
chars. > LINE_MAX (2048) bytes, the final words which don't fit'll get chopped.

https://github.com/NetBSD/src/blob/trunk/usr.bin/deroff/deroff.c#L144

Should I open a gnats ticket for this?


Yes. The simplest thing to do would be to just ditch that fixed-size buffer
and just suck in the entire line. That'll work if you have enough memory.

-RVP


Home | Main Index | Thread Index | Old Index