switch ${%foo} to wcswidth-like behaviour – slightly problematic, and

the “set +U” case isn’t even handled

committed to branch because I’d like to get more input on this, for now
This commit is contained in:
tg
2009-11-28 14:21:47 +00:00
parent 7063a9a921
commit 883d9d99b3
9 changed files with 37 additions and 21 deletions

4
misc.c
View File

@ -29,7 +29,7 @@
#include <grp.h>
#endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.131 2009/11/23 12:48:19 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.132 2009/11/28 14:21:45 tg Exp $");
unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */
@ -154,7 +154,7 @@ printoptions(bool verbose)
len = strlen(options[i].name);
if (len > octs)
octs = len;
len = utf_mbswidth(options[i].name);
len = utf_mbswidth(options[i].name, true);
if (len > oi.opt_width)
oi.opt_width = len;
}