[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Weirdness in comm(1)
On Fri, 27 Nov 2009 20:49:31 +0100
Joerg Sonnenberger <joerg%britannica.bec.de@localhost> wrote:
> On Fri, Nov 27, 2009 at 10:30:25AM -0500, D'Arcy J.M. Cain wrote:
> > Here's a little script that shows the issue. The attached patch fixes
> > it. Id does make it a bit busier but comm(1) would work right. Unless
> > someone has a reason not to I will commit this later today.
> Please use getline instead and just make line1 and line2 dynamically
> allocated. There is no point in having a line limit here and getline is
> reasonable efficient.
I just looked at the getline function and it seems that it still
includes the newline. That's the basic problem with fgets for comm and
is the reason I wrote my getnextln function.
Is it too late to suggest that getline (and getdelim) be changed to not
include the delimiter? It seems to me that adding a newline is always
going to be easier than removing one when necessary.
D'Arcy J.M. Cain <darcy%NetBSD.org@localhost>
Main Index |
Thread Index |