>From 3348dad8cd44857138662568b8cc076c3331903e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 8 Feb 2023 23:44:33 +0100 Subject: [PATCH 3/4] nl_langinfo: Add comment regarding per-thread locales. * lib/nl_langinfo.c (ctype_codeset): Add comment. --- ChangeLog | 3 +++ lib/nl_langinfo.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index a6b0d2eef7..97f810d1fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2023-02-08 Bruno Haible + nl_langinfo: Add comment regarding per-thread locales. + * lib/nl_langinfo.c (ctype_codeset): Add comment. + nl_langinfo tests: Add another test. * tests/test-nl_langinfo2.c: New file. * tests/test-nl_langinfo2.sh: New file. diff --git a/lib/nl_langinfo.c b/lib/nl_langinfo.c index 131166fd71..f872c6d5e2 100644 --- a/lib/nl_langinfo.c +++ b/lib/nl_langinfo.c @@ -70,6 +70,8 @@ static char * ctype_codeset (void) { + /* This function is only used on platforms which don't have uselocale(). + Therefore we don't need to look at the per-thread locale first, here. */ static char result[2 + 10 + 1]; char buf[2 + 10 + 1]; char locale[SETLOCALE_NULL_MAX]; -- 2.34.1