diff options
author | Rob Landley <rob@landley.net> | 2014-07-20 16:34:36 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-07-20 16:34:36 -0500 |
commit | 8fb779954829f923ee2935d81cd4446973aaa01f (patch) | |
tree | 6085977954403017154611a2dcca06bcf6188f65 /lib/portability.h | |
parent | 87c06e15329a0ef39385408a2e41be82e56a5418 (diff) | |
download | toybox-8fb779954829f923ee2935d81cd4446973aaa01f.tar.gz |
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/portability.h')
-rw-r--r-- | lib/portability.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/portability.h b/lib/portability.h index 1d540acf..b5fc0aca 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); |