Current-Users archive

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

Re: Weirdness in comm(1)



At Sat, 28 Nov 2009 12:55:56 -0500, "D'Arcy J.M. Cain" 
<darcy%NetBSD.org@localhost> wrote:
Subject: Re: Weirdness in comm(1)
> 
> I thought that getline(3) was too new to have idioms yet.  Wasn't it
> just added a few months ago?  It's not even in an official release.

It would appear that getline(3) (and getdelim(3) upon which it is built)
is defined by POSIX 1003.1-2008.  Sometimes POSIX can be stupid.  :-)
(so, no, you can't change it arbitrarily)

Personally I'm not sure why comm(1) isn't/wasn't using fgetln(3) in
order to avoid having a fixed line length limit.

I think whomever munged fgetstr(3) to be based on getdelim(3) in
-current may have broken it BADLY (likely, actually; re-introducing
bogus line length limits, sigh) -- they also forgot to update the manual
page (for both a new error and for its references).

I think the right fix would be to simply revert fgetstr(3) to the
previous implementation, but perhaps some common code can still be
squashed together.

Note that FreeBSD's comm(1) already uses getline(3), but I still think
using the _old_ fgetln(3) is better.

-- 
                                                Greg A. Woods
                                                Planix, Inc.

<woods%planix.com@localhost>       +1 416 218 0099        http://www.planix.com/

Attachment: pgpMMu0jk5GCJ.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index