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

@@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.33 2009/09/20 13:33:48 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.34 2009/11/28 14:21:46 tg Exp $");
/* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */
@@ -932,7 +932,7 @@ shf_vfprintf(struct shf *shf, const char *fmt, va_list args)
case 's':
if (!(s = va_arg(args, const char *)))
s = "(null)";
len = utf_mbswidth(s);
len = utf_mbswidth(s, true);
break;
case 'c':