Current-Users archive

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

Re: Weirdness in comm(1)

On Sat, Nov 28, 2009 at 12:55:56PM -0500, D'Arcy J.M. Cain wrote:
> > There are different issues with fgets -- leaving the delimiter is
> > certainly not the biggest. Note that getline returns the number of
> > characters read, so removing the delimiter if needed involves just a
> > simple check in the array.
> I suppose.  It means that we still need a getnextln function in comm.c
> to handle that.  We can't just call getline directly.

Even for the specific case of comm you can't just strip off the
trailling newline. You have to remember if you had one as well and only
compare lines as equal if they either both or none of them has it.


Home | Main Index | Thread Index | Old Index