diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 2 | ||||
-rw-r--r-- | shell/ash_test/.gitignore | 7 | ||||
-rw-r--r-- | shell/ash_test/ash-vars/var-utf8-length.right | 1 | ||||
-rwxr-xr-x | shell/ash_test/ash-vars/var-utf8-length.tests | 2 | ||||
-rw-r--r-- | shell/ash_test/printenv.c | 1 |
5 files changed, 13 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 57d192822..7cad34511 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -7026,6 +7026,8 @@ varvalue(char *name, int varflags, int flags, struct strlist *var_str_list) | |||
7026 | if (subtype == VSLENGTH && len > 0) { | 7026 | if (subtype == VSLENGTH && len > 0) { |
7027 | reinit_unicode_for_ash(); | 7027 | reinit_unicode_for_ash(); |
7028 | if (unicode_status == UNICODE_ON) { | 7028 | if (unicode_status == UNICODE_ON) { |
7029 | STADJUST(-len, expdest); | ||
7030 | discard = 0; | ||
7029 | len = unicode_strlen(p); | 7031 | len = unicode_strlen(p); |
7030 | } | 7032 | } |
7031 | } | 7033 | } |
diff --git a/shell/ash_test/.gitignore b/shell/ash_test/.gitignore new file mode 100644 index 000000000..a1f937cdd --- /dev/null +++ b/shell/ash_test/.gitignore | |||
@@ -0,0 +1,7 @@ | |||
1 | /ash | ||
2 | /printenv | ||
3 | /recho | ||
4 | /zecho | ||
5 | |||
6 | /*.fail | ||
7 | *.xx | ||
diff --git a/shell/ash_test/ash-vars/var-utf8-length.right b/shell/ash_test/ash-vars/var-utf8-length.right new file mode 100644 index 000000000..6f4247a62 --- /dev/null +++ b/shell/ash_test/ash-vars/var-utf8-length.right | |||
@@ -0,0 +1 @@ | |||
26 | |||
diff --git a/shell/ash_test/ash-vars/var-utf8-length.tests b/shell/ash_test/ash-vars/var-utf8-length.tests new file mode 100755 index 000000000..d04b2cbb6 --- /dev/null +++ b/shell/ash_test/ash-vars/var-utf8-length.tests | |||
@@ -0,0 +1,2 @@ | |||
1 | X=abcdÉfghÍjklmnÓpqrstÚvwcyz | ||
2 | echo ${#X} | ||
diff --git a/shell/ash_test/printenv.c b/shell/ash_test/printenv.c index c4ccda8a6..c0c5e197c 100644 --- a/shell/ash_test/printenv.c +++ b/shell/ash_test/printenv.c | |||
@@ -24,6 +24,7 @@ | |||
24 | with Bash; see the file COPYING. If not, write to the Free Software | 24 | with Bash; see the file COPYING. If not, write to the Free Software |
25 | Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ | 25 | Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ |
26 | 26 | ||
27 | #include <stdio.h> | ||
27 | #include <stdlib.h> | 28 | #include <stdlib.h> |
28 | #include <string.h> | 29 | #include <string.h> |
29 | 30 | ||