/bin/ls formatting broken for non-C(?) locales

Baptiste Daroussin bapt at freebsd.org
Wed Nov 25 00:15:18 UTC 2015


On Sat, Nov 21, 2015 at 11:57:46PM +0300, Andrey Chernov wrote:
> On 21.11.2015 15:18, Ed Schouten wrote:
> > Hi Baptiste,
> > 
> > I suppose you should use the wcswidth() function somewhere to compute
> > the visible width of the month name. Some characters may be
> > double-width, others may have no effective width at all.
> > 
> 
> I agree. Checking error return of wide chars functions with some
> fallback will be good too.

I have updated the code https://reviews.freebsd.org/D4239

Tested by modifying some locales to add double width and zero width unicode in
the locales

Also added the error checking for the return of wide chars functions. For now I
haven't added fallback, suggestions welcome if needed.

Best regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20151125/76629142/attachment.bin>


More information about the freebsd-current mailing list