since we have wcwidth anyway, expose it as ${%strvar} to the user, iff

utf8-mode is enabled (otherwise it'll be a synonym for ${#strvar} aka
the number of octets in it)
This commit is contained in:
tg
2009-11-21 23:23:20 +00:00
parent aa31a51e5f
commit 2094e3f25c
5 changed files with 91 additions and 16 deletions

4
lex.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.100 2009/10/04 12:45:22 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.101 2009/11/21 23:23:18 tg Exp $");
/*
* states while lexing word
@ -1548,7 +1548,7 @@ get_brace_var(XString *wsp, char *wp)
/* State machine to figure out where the variable part ends. */
switch (state) {
case PS_INITIAL:
if (c == '#' || c == '!') {
if (c == '#' || c == '!' || c == '%') {
state = PS_SAW_HASH;
break;
}