ash: fix corruption of ${#var} if $var contains UTF-8 characters
No binary (build failed)
—
(log yok)
| @@ -6692,6 +6692,8 @@ varvalue(char *name, int varflags, int flags, struct strlist *var_str_list) | |
| if (subtype == VSLENGTH && len > 0) { | |
| reinit_unicode_for_ash(); | |
| if (unicode_status == UNICODE_ON) { | |
| + | STADJUST(-len, expdest); |
| + | discard = 0; |
| len = unicode_strlen(p); | |
| } | |
| } | |
| @@ -0,0 +1 @@ | |
| + | 26 |
| @@ -0,0 +1,2 @@ | |
| + | X=abcdÉfghÍjklmnÓpqrstÚvwcyz |
| + | echo ${#X} |