CFT: BSD-licensed grep [Fwd: cvs commit: ports/textproc/bsdgrep Makefile distinfo]

Andrey Chernov ache at nagual.pp.ru
Wed Jun 18 11:44:59 UTC 2008


On Wed, Jun 18, 2008 at 11:39:10AM +0200, Dag-Erling Sm??rgrav wrote:
> Does that mean our wcsxfrm() doesn't work?  IIUC, it should convert
> wide strings to strings that can be compared directly with strcmp()?

(directly with wcscmp())
For single byte locales wcsxfrm() and wcscoll() works, but for multibyte 
they do just raw binary.

> In any case, this is a libc issue, right?  As long as sort / grep uses
> the API correctly, they will work fine once libc is fixed?

GNU grep and sort will work just fine.

BSD grep not calls setlocale() but even it will be added, BSD grep 
have other places where multibyte is not handled proberly. I already 
notice two of them: ignore case comparison and word boundary sensing, 
perhaps other places exists, I not study the code enough to cach them all.

BSD sort uses upper half of 256 char table on its own purposes so badly 
damage both single byte and multibyte locales and of couse not use 
wcscoll() at all etc.

-- 
http://ache.pp.ru/


More information about the freebsd-hackers mailing list