diff options
author | schwarze <> | 2018-03-29 16:34:25 +0000 |
---|---|---|
committer | schwarze <> | 2018-03-29 16:34:25 +0000 |
commit | 4cf76254cac6b537721bfd4326b9389be6d052a4 (patch) | |
tree | 561b1a1476449dbe2ac2e2b0dd21d33d3bab9fc7 /src/lib/libc/stdlib | |
parent | 8fbf91d36f6a0384bffbd2de8c4d2452da7fe4f3 (diff) | |
download | openbsd-4cf76254cac6b537721bfd4326b9389be6d052a4.tar.gz openbsd-4cf76254cac6b537721bfd4326b9389be6d052a4.tar.bz2 openbsd-4cf76254cac6b537721bfd4326b9389be6d052a4.zip |
Fix three bugs in setlocale(3):
1. setlocale(LC_ALL, "A"); setlocale(LC_CTYPE, "T"); setlocale(LC_ALL, NULL);
must return "A/T/A/A/A/A", not "A". Fix this by always initializing the
LC_ALL entry of newgl to "" in dupgl(). Reported by Karl Williamson
<public at khwilliamson dot com> on bugs@, thanks!
2. Do not leak newgl when strdup(3) fails in setlocale(3).
3. For setlocale(LC_ALL, "C/C/fr_FR.UTF-8/C/C/C"); correctly set
_GlobalRuneLocale; i found 2. and 3. while looking at the code.
Feedback on a buggy earlier version and OK martijn@.
Diffstat (limited to 'src/lib/libc/stdlib')
0 files changed, 0 insertions, 0 deletions