diff options
author | Brad King <brad.king@kitware.com> | 2017-05-25 15:26:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-25 19:03:03 (GMT) |
commit | 690acadc17263621f5361d48057c6f938e698a58 (patch) | |
tree | f82f1104363a018cba98a166acd98988a6c13150 /Source/cm_utf8.c | |
parent | ae5f98a5e36da8cf3c75625ffb9a1d34aa2407cb (diff) | |
download | CMake-690acadc17263621f5361d48057c6f938e698a58.zip CMake-690acadc17263621f5361d48057c6f938e698a58.tar.gz CMake-690acadc17263621f5361d48057c6f938e698a58.tar.bz2 |
codecvt: Re-implement do_out and do_unshift
The previous implementation assumed that only one byte would be given
in the `from` buffer by the caller at a time. This may be true for
MSVC but is not for the GNU library on Windows. Re-implement these
methods to handle more than one byte per call.
Also simplify the state management by keeping all state between calls
directly in the `mbstate_t` argument instead of using it to index our
own heap-allocated state.
Fixes: #16893
Diffstat (limited to 'Source/cm_utf8.c')
-rw-r--r-- | Source/cm_utf8.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cm_utf8.c b/Source/cm_utf8.c index 6c49b52..52af4a6 100644 --- a/Source/cm_utf8.c +++ b/Source/cm_utf8.c @@ -15,7 +15,7 @@ */ /* Number of leading ones before a zero in the byte. */ -static unsigned char const cm_utf8_ones[256] = { +unsigned char const cm_utf8_ones[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |