Hi Ken,
I think that buf may only be len long on occasion when the NUL is
added.
So could we get a Ralph-ified version? I think the necessary
configure glue should be straightforward, but someone else will have
to test it. I'd be glad to commit it, though.
I've written a getline(3) from scratch based on
https://manned.org/getdelim.3p and am happy for it to have whatever
licence nmh needs. I've assumed POSIX, e.g. stdbool.h, SSIZE_MAX, etc.,
so it may need some conditional preprocessor bits for portability to
older systems.
It's quite a fun problem because it's a bit of a "loop and a half" where
you don't want more input, but need to produce a bit more output. One
can spend ages re-arranging the deckchairs, but I finally went with the
attached.
--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy
getline.c
Description: getline.c implementation by Ralph Corderoy
_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers