BB: busybox: make high ASCII chars printable (#7993)
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 27 Oct 2014 11:22:41 +0000 (11:22 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 27 Oct 2014 11:22:41 +0000 (11:22 +0000)
Currently busybox utils like "ls" fail to display filenames containing UTF-8
characters, replacing any special characters with "?".

Change libbb's printable_string() function to allow high ASCII characters so
that unicode filenames are displayed correctls.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Backport of r43084

SVN-Revision: 43085

package/utils/busybox/Makefile
package/utils/busybox/patches/270-libbb_make_unicode_printable.patch [new file with mode: 0644]

index 668679e4d2193f62ef730a303616e8680f227c69..59a84a2f94592dda075299296f916ed16bf712be 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.22.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/package/utils/busybox/patches/270-libbb_make_unicode_printable.patch b/package/utils/busybox/patches/270-libbb_make_unicode_printable.patch
new file mode 100644 (file)
index 0000000..3bfd48a
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/libbb/printable_string.c
++++ b/libbb/printable_string.c
+@@ -31,8 +31,6 @@ const char* FAST_FUNC printable_string(u
+               }
+               if (c < ' ')
+                       break;
+-              if (c >= 0x7f)
+-                      break;
+               s++;
+       }
+@@ -45,7 +43,7 @@ const char* FAST_FUNC printable_string(u
+                       unsigned char c = *d;
+                       if (c == '\0')
+                               break;
+-                      if (c < ' ' || c >= 0x7f)
++                      if (c < ' ')
+                               *d = '?';
+                       d++;
+               }