svn commit: r204803 - head/usr.bin/uniq

David Schultz das at FreeBSD.ORG
Mon Mar 8 19:51:25 UTC 2010


On Sun, Mar 07, 2010, Andrey Chernov wrote:
> On Sun, Mar 07, 2010 at 09:31:39PM +0300, Andrey Chernov wrote:
> > It is right idea. I'll use sysconf(__SC_LINE_MAX) there.
> > But currently it does the same (sysconf.c):
> >         case _SC_LINE_MAX:
> >                 return (LINE_MAX);
> ...
> > To add more:
> > NetBSD uniq grows (contrary, NetBSD comm silently discarding everything 
> > afterwards).
> > OpenBSD uniq just use fgets with 8192.
> > GNU uniq grows.
> 
> After thinking a bit more I consider to reimplement unlimited lines here 
> instead because enforcing POSIX limit was not the main goal of my commit 
> (it was to remove getwc() which is evil). Someone may deal with the limit 
> on his own way afterwards.

Good.  I think it's better for usability if we avoid artificial
limits like this.

You can actually just call getline() rather than reinventing the
wheel.  I've had a wide character version of getline() ready to
commit for some time (I just need to find the time to do it), so
you won't need to call mbstowcs() as a separate step.


More information about the svn-src-all mailing list