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

6
exec.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.68 2009/11/09 23:35:09 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.69 2009/11/28 14:21:43 tg Exp $");
static int comexec(struct op *, struct tbl *volatile, const char **,
int volatile, volatile int *);
@ -1380,7 +1380,7 @@ pr_menu(const char * const *ap)
i = strlen(*pp);
if (i > aocts)
aocts = i;
i = utf_mbswidth(*pp);
i = utf_mbswidth(*pp, true);
if (i > acols)
acols = i;
}
@ -1420,7 +1420,7 @@ pr_list(char * const *ap)
i = strlen(*pp);
if (i > aocts)
aocts = i;
i = utf_mbswidth(*pp);
i = utf_mbswidth(*pp, true);
if (i > acols)
acols = i;
}