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

David Schultz das at FreeBSD.ORG
Tue Mar 9 17:55:47 UTC 2010


On Mon, Mar 08, 2010, Andrey Chernov wrote:
> > 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.
> 
> It does not help, since wide version will fail on EILSEQ with sync lost,
> as getwc() does. Initially I was thinking about ftell+fseek back, but not 
> all files are seekable.
> 
> BTW, I plan to made similar changes to comm(1) too, it suffer from the 
> same EILSEQ problem.

Actually, a question...why doesn't it suffice to simply call
strcoll() instead of mbstowcs() followed by wcscoll()?
I would expect that in the absence of the -i flag, none of
this would be necessary.  At the very least, it would make
sense to start with a strcmp(), and only fall back on the
expensive conversion and collation if the strings don't
compare equal.


More information about the svn-src-all mailing list