summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-07-20 16:34:36 -0500
committerRob Landley <rob@landley.net>2014-07-20 16:34:36 -0500
commit8fb779954829f923ee2935d81cd4446973aaa01f (patch)
tree6085977954403017154611a2dcca06bcf6188f65 /lib
parent87c06e15329a0ef39385408a2e41be82e56a5418 (diff)
downloadtoybox-8fb779954829f923ee2935d81cd4446973aaa01f.tar.gz
toybox-8fb779954829f923ee2935d81cd4446973aaa01f.tar.bz2
toybox-8fb779954829f923ee2935d81cd4446973aaa01f.zip
Add utf8 support to ls -C.
Use wcwidth() instead of strlen(), and extend the -q substitution to also whiteout nonprintable characters that are nonparseable utf8 snippets.
Diffstat (limited to 'lib')
-rw-r--r--lib/portability.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/portability.h b/lib/portability.h
index 1d540ac..b5fc0ac 100644
--- a/lib/portability.h
+++ b/lib/portability.h
@@ -60,6 +60,11 @@
// http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html
char *crypt(const char *key, const char *salt);
+// According to posix, #include header, get a function definition. But glibc...
+// http://pubs.opengroup.org/onlinepubs/9699919799/functions/wcwidth.html
+#include <wchar.h>
+int wcwidth(wchar_t wc);
+
// see http://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html
#include <time.h>
char *strptime(const char *buf, const char *format, struct tm *tm);