[illumos-Developer] webrev - fix for 169 Lack of "rune" wctype breaks tr -C

Joerg Schilling Joerg.Schilling at fokus.fraunhofer.de
Fri Sep 10 16:16:29 PDT 2010


"Garrett D'Amore" <garrett at damore.org> wrote:

> They are not used anywhere in Solaris.
>
> We don't use BSD character width info in the same way, because we had
> requirements to retain compatibility with Solaris' encoding of the ctype
> data.  We're good here, but thanks for your concern.

Sure?

int
wcwidth(wchar_t wc)
{
        unsigned int x;

        if (wc == 0)
                return (0);

        x = ((wc < 0 || wc >= _CACHED_RUNES) ? ___runetype(wc) :
            _CurrentRuneLocale->__runetype[wc]) & (_CTYPE_SWM|_CTYPE_R);

        if ((x & _CTYPE_SWM) != 0)
                return ((x & _CTYPE_SWM) >> _CTYPE_SWS);
        return ((x & _CTYPE_R) != 0 ? 1 : -1);
}

looks af if it still uses the two top bits to code the character width.

Jörg

-- 
 EMail:joerg at schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js at cs.tu-berlin.de                (uni)  
       joerg.schilling at fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily



More information about the Developer mailing list