diff options
author | Rob Landley <rob@landley.net> | 2017-09-02 18:15:09 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-09-02 18:15:09 -0500 |
commit | 67ddade3373d0fefeff25b48430e5f08c3a7711b (patch) | |
tree | ead8c34b2a28655eef456b0afa104a438cae2a02 /toys/posix | |
parent | bebf14cc298eb41d8e5c245e3800aea69ecca08c (diff) | |
download | toybox-67ddade3373d0fefeff25b48430e5f08c3a7711b.tar.gz |
In wc, replace mbrtowc() with new utf8towc() which doesn't have a context struct
or care about locale.
Diffstat (limited to 'toys/posix')
-rw-r--r-- | toys/posix/wc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/toys/posix/wc.c b/toys/posix/wc.c index a8c3e452..96ff9788 100644 --- a/toys/posix/wc.c +++ b/toys/posix/wc.c @@ -80,6 +80,7 @@ static void do_wc(int fd, char *name) // next wide size, don't count invalid, fetch more data if necessary clen = mbrtowc(&wchar, toybuf+pos, len-pos, 0); + clen = utf8towc(&wchar, toybuf+pos, len-pos); if (clen == -1) continue; if (clen == -2 && !done) break; |