From 3e3bfb896e0dd8a54caad9c6264e2452566b4012 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 18 Mar 2016 11:29:19 +0000 Subject: ash: fix corruption of ${#var} if $var contains UTF-8 characters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As reported in bug 8506: $ X=abcdÉfghÍjklmnÓpqrstÚvwcyz $ echo ${#X} abcd26 The result should be 26. This regression was introduced by: 2015-05-18 [Ron Yorston] ash: code shrink around varvalue The length in characters was being used to discard the contents of the variable instead of the length in bytes. URL: https://bugs.busybox.net/8506 Reported-by: Martijn Dekker Signed-off-by: Ron Yorston Signed-off-by: Mike Frysinger --- shell/ash_test/ash-vars/var-utf8-length.right | 1 + 1 file changed, 1 insertion(+) create mode 100644 shell/ash_test/ash-vars/var-utf8-length.right (limited to 'shell/ash_test/ash-vars/var-utf8-length.right') 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 -- cgit v1.2.3