summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-01-27 09:52:18 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2015-01-27 09:52:18 +0100
commit1ecfe811fe2f70380170ef7d820e8150054e88ca (patch)
tree2ecabb7c7b054ae8146942d08f361380473fb0db /shell/ash.c
parent6968e081230fb6434a2a6f0eed39d538ea982f3f (diff)
downloadbusybox-1ecfe811fe2f70380170ef7d820e8150054e88ca.tar.gz
Apply post-1.23.0 patches, bump version to 1.23.11_23_1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 90fb00fbd..c5ad96909 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6746,6 +6746,14 @@ varvalue(char *name, int varflags, int flags, struct strlist *var_str_list)
len = strlen(p);
if (!(subtype == VSPLUS || subtype == VSLENGTH))
memtodest(p, len, syntax, quotes);
+#if ENABLE_UNICODE_SUPPORT
+ if (subtype == VSLENGTH && len > 0) {
+ reinit_unicode_for_ash();
+ if (unicode_status == UNICODE_ON) {
+ len = unicode_strlen(p);
+ }
+ }
+#endif
return len;
}
@@ -6829,15 +6837,7 @@ evalvar(char *p, int flags, struct strlist *var_str_list)
varunset(p, var, 0, 0);
if (subtype == VSLENGTH) {
- ssize_t n = varlen;
- if (n > 0) {
- reinit_unicode_for_ash();
- if (unicode_status == UNICODE_ON) {
- const char *val = lookupvar(var);
- n = unicode_strlen(val);
- }
- }
- cvtnum(n > 0 ? n : 0);
+ cvtnum(varlen > 0 ? varlen : 0);
goto record;
}