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
var.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.96 2009/10/18 12:30:06 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.97 2009/11/28 14:21:47 tg Exp $");
/*
* Variables
@ -574,7 +574,7 @@ formatstr(struct tbl *vp, const char *s)
char *p, *q;
size_t psiz;
olen = utf_mbswidth(s);
olen = utf_mbswidth(s, true);
if (vp->flag & (RJUST|LJUST)) {
if (!vp->u2.field) /* default field width */