diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 13:24:07 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 13:24:07 +0100 |
| commit | cfd1f17f1a85d95ea12bca8dae42add7dad1ad11 (patch) | |
| tree | 8016486f8ee7157213f2d09ff2491bfa9c94638a /lib/mbrtowc-impl.h | |
| parent | 14e4d584d0121031ec40e6c35869745f1747ff29 (diff) | |
| parent | 1403307d6e2fb4e7b5d97a35f40d1e95134561ab (diff) | |
Merge branch 'release/debian/1.4.2-1'HEADdebian/1.4.2-1master
Diffstat (limited to 'lib/mbrtowc-impl.h')
| -rw-r--r-- | lib/mbrtowc-impl.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/mbrtowc-impl.h b/lib/mbrtowc-impl.h index 963631ca..21a3998c 100644 --- a/lib/mbrtowc-impl.h +++ b/lib/mbrtowc-impl.h @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2024 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -41,8 +41,6 @@ char buf[4]; const char *p; size_t m; - enc_t enc; - int res; switch (nstate) { @@ -75,7 +73,8 @@ /* Here m > 0. */ - enc = locale_encoding_classification (); + enc_t enc = locale_encoding_classification (); + int res; if (enc == enc_utf8) /* UTF-8 */ { @@ -89,17 +88,19 @@ { /* The hidden internal state of mbtowc would make this function not multi-thread safe. Achieve multi-thread safety through a lock. */ - wchar_t wc; - res = mbtowc_with_lock (&wc, p, m); + { + wchar_t wc; + res = mbtowc_with_lock (&wc, p, m); - if (res >= 0) - { - if ((wc == 0) != (res == 0)) - abort (); - if (pwc != NULL) - *pwc = wc; - goto success; - } + if (res >= 0) + { + if ((wc == 0) != (res == 0)) + abort (); + if (pwc != NULL) + *pwc = wc; + goto success; + } + } /* mbtowc does not distinguish between invalid and incomplete multibyte sequences. But mbrtowc needs to make this distinction. |
