diff options
Diffstat (limited to 'lib/unicase')
102 files changed, 446 insertions, 431 deletions
diff --git a/lib/unicase/cased.c b/lib/unicase/cased.c index 6014c62d..356e2e4e 100644 --- a/lib/unicase/cased.c +++ b/lib/unicase/cased.c @@ -1,5 +1,5 @@ /* Test whether a Unicode character is cased. - Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/cased.h b/lib/unicase/cased.h index 16e548e3..cab78f94 100644 --- a/lib/unicase/cased.h +++ b/lib/unicase/cased.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Casing Properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". @@ -308,7 +308,7 @@ u_casing_property_cased = 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xF7FFFFFFU, 0xFFFFFFF0U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFEFFFFFU, 0x01FFFFFFU, 0x00000003U, 0x0000001FU, + 0xFFCFFFFFU, 0x01FFFFFFU, 0x00000003U, 0x0000001FU, 0x00000000U, 0x00000000U, 0x00000020U, 0xBCCF0000U, 0xFFFFD740U, 0xFFFFFFFBU, 0xFFFFFFFFU, 0xFFBFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, @@ -346,7 +346,7 @@ u_casing_property_cased = 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0x00003FFFU, 0x3FFFFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFCU, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0xFFFF78FFU, 0xFFFFFFFFU, 0x1FEB3FFFU, 0x077C0000U, + 0xFFFF78FFU, 0xFFFFFFFFU, 0x1FFFFFFFU, 0x077E0000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFF0000U, 0xF7FFFFFFU, 0xFFFF03FFU, @@ -376,7 +376,7 @@ u_casing_property_cased = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0xF9FFFFFFU, 0x000FFFFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFDFFFFFU, 0xFFFFFFFFU, diff --git a/lib/unicase/casefold.h b/lib/unicase/casefold.h index bb320678..573ae4fd 100644 --- a/lib/unicase/casefold.h +++ b/lib/unicase/casefold.h @@ -1,5 +1,5 @@ /* Casefolding of Unicode characters. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/caseprop.h b/lib/unicase/caseprop.h index d6b95bd1..a469f316 100644 --- a/lib/unicase/caseprop.h +++ b/lib/unicase/caseprop.h @@ -1,5 +1,5 @@ /* Case related properties of Unicode characters. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/context.h b/lib/unicase/context.h index 541da561..5b1c8b62 100644 --- a/lib/unicase/context.h +++ b/lib/unicase/context.h @@ -1,5 +1,5 @@ /* Case-mapping contexts of UTF-8/UTF-16/UTF-32 substring. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/empty-prefix-context.c b/lib/unicase/empty-prefix-context.c index 1a99d6f2..897e9f40 100644 --- a/lib/unicase/empty-prefix-context.c +++ b/lib/unicase/empty-prefix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of empty prefix string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/empty-suffix-context.c b/lib/unicase/empty-suffix-context.c index 2e5bc33c..c000056f 100644 --- a/lib/unicase/empty-suffix-context.c +++ b/lib/unicase/empty-suffix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of empty suffix string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/ignorable.c b/lib/unicase/ignorable.c index c4d41351..3e17f6af 100644 --- a/lib/unicase/ignorable.c +++ b/lib/unicase/ignorable.c @@ -1,5 +1,5 @@ /* Test whether a Unicode character is case-ignorable. - Copyright (C) 2002, 2006-2007, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/ignorable.h b/lib/unicase/ignorable.h index c59ceab1..e8a53114 100644 --- a/lib/unicase/ignorable.h +++ b/lib/unicase/ignorable.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Casing Properties of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". @@ -35,7 +35,7 @@ struct int header[1]; int level1[15]; short level2[3 << 7]; - unsigned int level3[57 << 4]; + unsigned int level3[58 << 4]; } u_casing_property_case_ignorable = { @@ -301,20 +301,20 @@ u_casing_property_case_ignorable = 16 + 384 * sizeof (short) / sizeof (int) + 816, 16 + 384 * sizeof (short) / sizeof (int) + 832, 16 + 384 * sizeof (short) / sizeof (int) + 848, - -1, 16 + 384 * sizeof (short) / sizeof (int) + 864, + 16 + 384 * sizeof (short) / sizeof (int) + 880, -1, -1, -1, -1, - 16 + 384 * sizeof (short) / sizeof (int) + 880, + 16 + 384 * sizeof (short) / sizeof (int) + 896, -1, -1, -1, -1, -1, -1, - 16 + 384 * sizeof (short) / sizeof (int) + 896, + 16 + 384 * sizeof (short) / sizeof (int) + 912, -1, -1, -1, @@ -493,7 +493,7 @@ u_casing_property_case_ignorable = 0x00000000U, 0x0E040187U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x09800000U, 0x00000000U, 0x7F400000U, 0x9FF81FE5U, - 0x00000000U, 0xFFFF0080U, 0x00007FFFU, 0x00000000U, + 0x00000000U, 0xFFFF0080U, 0x3FFFFFFFU, 0x00000FFFU, 0x0000000FU, 0x17D00000U, 0x00000004U, 0x000FF800U, 0x00000003U, 0x00003B3CU, 0x00000000U, 0x0003A340U, 0x00000000U, 0x00CFF000U, 0x00000000U, 0x3F000000U, @@ -569,7 +569,7 @@ u_casing_property_case_ignorable = 0x00000000U, 0x000000F0U, 0x00004000U, 0x0000BE00U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00001800U, 0x00000000U, 0xF0000000U, + 0x00000000U, 0x00001800U, 0x00000020U, 0xFC000000U, 0x00000000U, 0x00000000U, 0x0001FFC0U, 0x00000000U, 0x0000003CU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000002U, 0xFF000000U, 0x0000007FU, 0x80190000U, @@ -594,12 +594,12 @@ u_casing_property_case_ignorable = 0x00000000U, 0x00000000U, 0x0CF00000U, 0x00000001U, 0x000007FEU, 0x79F80000U, 0x0E7E0080U, 0x00000000U, 0x037FFC00U, 0x00000000U, 0x00000000U, 0x00000000U, - 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x0000005DU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0xBF7F0000U, 0x00000000U, 0x00000000U, 0xFFFC0000U, 0x006DFCFFU, 0x00000000U, 0x00000000U, 0x00000000U, 0xB47E0000U, 0x000000BFU, 0x00000000U, - 0x00A30000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00A30000U, 0x00000000U, 0x02000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00180000U, 0x00000003U, 0x07C00000U, 0x04000005U, 0x00000000U, @@ -623,7 +623,7 @@ u_casing_property_case_ignorable = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00008000U, 0x00000000U, - 0xFFFF8000U, 0x00000000U, 0x00000000U, 0x0000001BU, + 0xFFFF8000U, 0x00000000U, 0x00000000U, 0x000C001BU, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, @@ -661,6 +661,10 @@ u_casing_property_case_ignorable = 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x0000C000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x8020C048U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, + 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x007F0000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000FF0U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, 0x00000000U, diff --git a/lib/unicase/invariant.h b/lib/unicase/invariant.h index 136c6301..5059aef5 100644 --- a/lib/unicase/invariant.h +++ b/lib/unicase/invariant.h @@ -1,5 +1,5 @@ /* Internal functions for Unicode character case mappings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/locale-language.c b/lib/unicase/locale-language.c index b7103e4a..0481e9b7 100644 --- a/lib/unicase/locale-language.c +++ b/lib/unicase/locale-language.c @@ -1,5 +1,5 @@ /* Language code of current locale. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -39,10 +39,9 @@ const char * uc_locale_language (void) { const char *locale_name = gl_locale_name (LC_CTYPE, "LC_CTYPE"); - const char *p; /* Find the end of the language portion. */ - p = locale_name; + const char *p = locale_name; while (*p != '\0' && *p != '_' && *p != '.' && *p != '@') p++; diff --git a/lib/unicase/locale-languages.gperf b/lib/unicase/locale-languages.gperf index 9db15582..fb1eb1bc 100644 --- a/lib/unicase/locale-languages.gperf +++ b/lib/unicase/locale-languages.gperf @@ -1,5 +1,5 @@ /* Language codes of locales. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unicase/locale-languages.h b/lib/unicase/locale-languages.h index 1deb4c4d..a82829b2 100644 --- a/lib/unicase/locale-languages.h +++ b/lib/unicase/locale-languages.h @@ -1,5 +1,5 @@ -/* ANSI-C code produced by gperf version 3.2 */ -/* Command-line: gperf -m 10 ./unicase/locale-languages.gperf */ +/* ANSI-C code produced by gperf version 3.3 */ +/* Command-line: gperf -m 10 unicase/locale-languages.gperf */ /* Computed positions: -k'1-3' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -84,17 +84,17 @@ uc_locale_language_hash (register const char *str, register size_t len) { default: hval += asso_values[(unsigned char)str[2]+2]; -#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3)) +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) [[fallthrough]]; -#elif defined __GNUC__ && __GNUC__ >= 7 +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) __attribute__ ((__fallthrough__)); #endif /*FALLTHROUGH*/ case 2: hval += asso_values[(unsigned char)str[1]+17]; -#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3)) +#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9))) [[fallthrough]]; -#elif defined __GNUC__ && __GNUC__ >= 7 +#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10) __attribute__ ((__fallthrough__)); #endif /*FALLTHROUGH*/ @@ -1034,9 +1034,9 @@ uc_locale_languages_lookup (register const char *str, register size_t len) return s; } } - return 0; + return (const char *) 0; } -#line 295 "./unicase/locale-languages.gperf" +#line 295 "unicase/locale-languages.gperf" /* * Local Variables: diff --git a/lib/unicase/simple-mapping.h b/lib/unicase/simple-mapping.h index 6102b768..2b3d21d6 100644 --- a/lib/unicase/simple-mapping.h +++ b/lib/unicase/simple-mapping.h @@ -1,5 +1,5 @@ /* Simple case mapping for Unicode characters. - Copyright (C) 2002, 2006, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software: you can redistribute it and/or modify diff --git a/lib/unicase/special-casing-table.gperf b/lib/unicase/special-casing-table.gperf index f4b82c35..1399d12d 100644 --- a/lib/unicase/special-casing-table.gperf +++ b/lib/unicase/special-casing-table.gperf @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Special casing rules of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unicase/special-casing-table.h b/lib/unicase/special-casing-table.h index 3681d2d9..1ceb1c56 100644 --- a/lib/unicase/special-casing-table.h +++ b/lib/unicase/special-casing-table.h @@ -1,4 +1,4 @@ -/* ANSI-C code produced by gperf version 3.2 */ +/* ANSI-C code produced by gperf version 3.3 */ /* Command-line: gperf -m 10 unicase/special-casing-table.gperf */ /* Computed positions: -k'1-3' */ @@ -50,6 +50,7 @@ gl_unicase_special_hash (register const char *str, register size_t len) 46, 122, 42, 41, 39, 122, 38, 35, 122, 122, 122, 0, 33, 122, 122, 122, 122 }; + (void) len; return asso_values[(unsigned char)str[2]+1] + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]]; } @@ -68,6 +69,10 @@ gl_unicase_special_lookup (register const char *str, register size_t len) 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; +#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif static const struct special_casing_rule wordlist[] = { #line 150 "unicase/special-casing-table.gperf" @@ -315,6 +320,9 @@ gl_unicase_special_lookup (register const char *str, register size_t len) #line 155 "unicase/special-casing-table.gperf" {"\373\006\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0053, 0x0054, 0 }, { 0xFB06, 0, 0 }, { 0x0053, 0x0074, 0 }, { 0x0073, 0x0074, 0 }} }; +#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3) +#pragma GCC diagnostic pop +#endif if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { @@ -329,5 +337,5 @@ gl_unicase_special_lookup (register const char *str, register size_t len) return &wordlist[key]; } } - return 0; + return (struct special_casing_rule *) 0; } diff --git a/lib/unicase/special-casing.c b/lib/unicase/special-casing.c index 856b904f..befde291 100644 --- a/lib/unicase/special-casing.c +++ b/lib/unicase/special-casing.c @@ -1,5 +1,5 @@ /* Special casing table. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/special-casing.in.h b/lib/unicase/special-casing.in.h index db8b8438..21ec9e12 100644 --- a/lib/unicase/special-casing.in.h +++ b/lib/unicase/special-casing.in.h @@ -1,5 +1,5 @@ /* Special casing table. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -23,6 +23,11 @@ License and of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ +/* This file uses _GL_ATTRIBUTE_NONSTRING. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + #include <stddef.h> #ifdef __cplusplus @@ -46,7 +51,7 @@ struct special_casing_rule { /* The first two bytes are the code, in big-endian order. The third byte only distinguishes different rules pertaining to the same code. */ - /*unsigned*/ char code[3]; + /*unsigned*/ char code[3] _GL_ATTRIBUTE_NONSTRING; /* True when this rule is not the last one for the given code. */ /*bool*/ unsigned int has_next : 1; diff --git a/lib/unicase/tocasefold.c b/lib/unicase/tocasefold.c index eac68a25..60d4ca11 100644 --- a/lib/unicase/tocasefold.c +++ b/lib/unicase/tocasefold.c @@ -1,5 +1,5 @@ /* Casefold mapping for Unicode characters (locale and context independent). - Copyright (C) 2002, 2006, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/tocasefold.h b/lib/unicase/tocasefold.h index c8e54ddb..21f1c589 100644 --- a/lib/unicase/tocasefold.h +++ b/lib/unicase/tocasefold.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Simple character mapping of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". @@ -35,7 +35,7 @@ struct { int level1[2]; short level2[2 << 9]; - int level3[38 << 7]; + int level3[39 << 7]; } u_mapping = { @@ -132,7 +132,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 4608, -1, -1, -1, + -1, -1, -1, -1, 4608, 4736, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -163,7 +163,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 4736, -1, -1, -1, -1, -1, + -1, -1, 4864, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -580,8 +580,8 @@ u_mapping = -42258, -42282, -42261, 928, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -48, -42307, -35384, 1, - 0, 1, 0, -42343, 1, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, + 0, 1, 0, -42343, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -42561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -763,6 +763,22 @@ u_mapping = 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, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 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, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, diff --git a/lib/unicase/tolower.c b/lib/unicase/tolower.c index 0a62cd50..89676ad6 100644 --- a/lib/unicase/tolower.c +++ b/lib/unicase/tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for Unicode characters (locale and context independent). - Copyright (C) 2002, 2006, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software: you can redistribute it and/or modify diff --git a/lib/unicase/tolower.h b/lib/unicase/tolower.h index 794f4c0c..f06dacf5 100644 --- a/lib/unicase/tolower.h +++ b/lib/unicase/tolower.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Simple character mapping of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 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 @@ -27,7 +27,7 @@ struct { int level1[2]; short level2[2 << 9]; - int level3[36 << 7]; + int level3[37 << 7]; } u_mapping = { @@ -124,7 +124,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 4352, -1, -1, -1, + -1, -1, -1, -1, 4352, 4480, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -155,7 +155,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 4480, -1, -1, -1, -1, -1, + -1, -1, 4608, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -572,8 +572,8 @@ u_mapping = -42258, -42282, -42261, 928, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -48, -42307, -35384, 1, - 0, 1, 0, -42343, 1, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 1, 0, + 0, 1, 0, -42343, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -42561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -723,6 +723,22 @@ u_mapping = 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, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 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, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, diff --git a/lib/unicase/totitle.c b/lib/unicase/totitle.c index db6b2847..32924213 100644 --- a/lib/unicase/totitle.c +++ b/lib/unicase/totitle.c @@ -1,5 +1,5 @@ /* Titlecase mapping for Unicode characters (locale and context independent). - Copyright (C) 2002, 2006, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/totitle.h b/lib/unicase/totitle.h index ed17a52d..ddab63a5 100644 --- a/lib/unicase/totitle.h +++ b/lib/unicase/totitle.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Simple character mapping of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". @@ -35,7 +35,7 @@ struct { int level1[2]; short level2[2 << 9]; - int level3[42 << 7]; + int level3[43 << 7]; } u_mapping = { @@ -132,7 +132,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 5120, -1, -1, -1, + -1, -1, -1, -1, 5120, 5248, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -163,7 +163,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 5248, -1, -1, -1, -1, -1, + -1, -1, 5376, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -644,8 +644,8 @@ u_mapping = 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, - -1, 0, -1, 0, 0, -1, 0, 0, - 0, -1, 0, 0, 0, 0, 0, -1, + -1, 0, -1, 0, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -831,6 +831,22 @@ u_mapping = 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, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, 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, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, diff --git a/lib/unicase/toupper.c b/lib/unicase/toupper.c index c7f86157..86cbffee 100644 --- a/lib/unicase/toupper.c +++ b/lib/unicase/toupper.c @@ -1,5 +1,5 @@ /* Uppercase mapping for Unicode characters (locale and context independent). - Copyright (C) 2002, 2006, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software: you can redistribute it and/or modify diff --git a/lib/unicase/toupper.h b/lib/unicase/toupper.h index ff117e05..a5040ba4 100644 --- a/lib/unicase/toupper.h +++ b/lib/unicase/toupper.h @@ -1,8 +1,8 @@ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Simple character mapping of Unicode characters. */ -/* Generated automatically by gen-uni-tables.c for Unicode 16.0.0. */ +/* Generated automatically by gen-uni-tables.c for Unicode 17.0.0. */ -/* Copyright (C) 2000-2024 Free Software Foundation, Inc. +/* Copyright (C) 2000-2025 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 @@ -27,7 +27,7 @@ struct { int level1[2]; short level2[2 << 9]; - int level3[43 << 7]; + int level3[44 << 7]; } u_mapping = { @@ -124,7 +124,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 5248, -1, -1, -1, + -1, -1, -1, -1, 5248, 5376, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -155,7 +155,7 @@ u_mapping = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 5376, -1, -1, -1, -1, -1, + -1, -1, 5504, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -652,8 +652,8 @@ u_mapping = 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, - -1, 0, -1, 0, 0, -1, 0, 0, - 0, -1, 0, 0, 0, 0, 0, -1, + -1, 0, -1, 0, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -839,6 +839,22 @@ u_mapping = 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, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, 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, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, diff --git a/lib/unicase/u-casecmp.h b/lib/unicase/u-casecmp.h index f960b6b9..f1515e11 100644 --- a/lib/unicase/u-casecmp.h +++ b/lib/unicase/u-casecmp.h @@ -1,5 +1,5 @@ /* Case and normalization insensitive comparison of Unicode strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -27,29 +27,23 @@ int FUNC (const SRC_UNIT *s1, size_t n1, const SRC_UNIT *s2, size_t n2, const char *iso639_language, uninorm_t nf, int *resultp) { - UNIT buf1[2048 / sizeof (UNIT)]; - UNIT buf2[2048 / sizeof (UNIT)]; - UNIT *norms1; - size_t norms1_length; - UNIT *norms2; - size_t norms2_length; - int cmp; - /* Optimization: There is no need to do canonical composition of each string. Decomposition is enough. */ if (nf != NULL) nf = uninorm_decomposing_form (nf); /* Case-fold and normalize S1. */ - norms1_length = sizeof (buf1) / sizeof (UNIT); - norms1 = U_CASEFOLD (s1, n1, iso639_language, nf, buf1, &norms1_length); + UNIT buf1[2048 / sizeof (UNIT)]; + size_t norms1_length = sizeof (buf1) / sizeof (UNIT); + UNIT *norms1 = U_CASEFOLD (s1, n1, iso639_language, nf, buf1, &norms1_length); if (norms1 == NULL) /* errno is set here. */ return -1; /* Case-fold and normalize S2. */ - norms2_length = sizeof (buf2) / sizeof (UNIT); - norms2 = U_CASEFOLD (s2, n2, iso639_language, nf, buf2, &norms2_length); + UNIT buf2[2048 / sizeof (UNIT)]; + size_t norms2_length = sizeof (buf2) / sizeof (UNIT); + UNIT *norms2 = U_CASEFOLD (s2, n2, iso639_language, nf, buf2, &norms2_length); if (norms2 == NULL) { if (norms1 != buf1) @@ -62,7 +56,7 @@ FUNC (const SRC_UNIT *s1, size_t n1, const SRC_UNIT *s2, size_t n2, } /* Compare the normalized strings. */ - cmp = U_CMP2 (norms1, norms1_length, norms2, norms2_length); + int cmp = U_CMP2 (norms1, norms1_length, norms2, norms2_length); if (cmp > 0) cmp = 1; else if (cmp < 0) diff --git a/lib/unicase/u-casecoll.h b/lib/unicase/u-casecoll.h index f65d958d..74c0697f 100644 --- a/lib/unicase/u-casecoll.h +++ b/lib/unicase/u-casecoll.h @@ -1,6 +1,6 @@ /* Locale dependent, case and normalization insensitive comparison of Unicode strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -28,25 +28,19 @@ int FUNC (const UNIT *s1, size_t n1, const UNIT *s2, size_t n2, const char *iso639_language, uninorm_t nf, int *resultp) { - char buf1[2048]; - char buf2[2048]; - char *transformed1; - size_t transformed1_length; - char *transformed2; - size_t transformed2_length; - int cmp; - /* Normalize and transform S1. */ - transformed1_length = sizeof (buf1); - transformed1 = + char buf1[2048]; + size_t transformed1_length = sizeof (buf1); + char *transformed1 = U_CASEXFRM (s1, n1, iso639_language, nf, buf1, &transformed1_length); if (transformed1 == NULL) /* errno is set here. */ return -1; /* Normalize and transform S2. */ - transformed2_length = sizeof (buf2); - transformed2 = + char buf2[2048]; + size_t transformed2_length = sizeof (buf2); + char *transformed2 = U_CASEXFRM (s2, n2, iso639_language, nf, buf2, &transformed2_length); if (transformed2 == NULL) { @@ -60,8 +54,8 @@ FUNC (const UNIT *s1, size_t n1, const UNIT *s2, size_t n2, } /* Compare the transformed strings. */ - cmp = memcmp2 (transformed1, transformed1_length, - transformed2, transformed2_length); + int cmp = memcmp2 (transformed1, transformed1_length, + transformed2, transformed2_length); if (cmp < 0) cmp = -1; else if (cmp > 0) diff --git a/lib/unicase/u-casefold.h b/lib/unicase/u-casefold.h index 173a6d4c..d4b6aa79 100644 --- a/lib/unicase/u-casefold.h +++ b/lib/unicase/u-casefold.h @@ -1,5 +1,5 @@ /* Casefolding mapping for Unicode strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u-casemap.h b/lib/unicase/u-casemap.h index 20690dfa..abb67820 100644 --- a/lib/unicase/u-casemap.h +++ b/lib/unicase/u-casemap.h @@ -1,5 +1,5 @@ /* Case mapping for UTF-8/UTF-16/UTF-32 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -35,10 +35,7 @@ FUNC (const UNIT *s, size_t n, { /* The result being accumulated. */ UNIT *result; - size_t length; size_t allocated; - - /* Initialize the accumulator. */ if (nf != NULL || resultbuf == NULL) { result = NULL; @@ -49,7 +46,7 @@ FUNC (const UNIT *s, size_t n, result = resultbuf; allocated = *lengthp; } - length = 0; + size_t length = 0; { const UNIT *s_end = s + n; @@ -97,10 +94,10 @@ FUNC (const UNIT *s, size_t n, { /* Does the context apply? */ int context = rule->context; - bool applies; - if (context < 0) context = - context; + + bool applies; switch (context) { case SCC_ALWAYS: @@ -281,15 +278,65 @@ FUNC (const UNIT *s, size_t n, found_mapping: /* Found the mapping: uc maps to mapped_uc[0..mapped_count-1]. */ - { - unsigned int i; + for (unsigned int i = 0; i < mapped_count; i++) + { + ucs4_t muc = mapped_uc[i]; - for (i = 0; i < mapped_count; i++) + /* Append muc to the result accumulator. */ + if (length < allocated) + { + int ret = U_UCTOMB (result + length, muc, allocated - length); + if (ret == -1) + { + errno = EINVAL; + goto fail; + } + if (ret >= 0) + { + length += ret; + goto done_appending; + } + } { - ucs4_t muc = mapped_uc[i]; - - /* Append muc to the result accumulator. */ - if (length < allocated) + size_t old_allocated = allocated; + size_t new_allocated = 2 * old_allocated; + if (new_allocated < 64) + new_allocated = 64; + if (new_allocated < old_allocated) /* integer overflow? */ + abort (); + { + UNIT *larger_result; + if (result == NULL) + { + larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail; + } + } + else if (result == resultbuf) + { + larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail; + } + U_CPY (larger_result, resultbuf, length); + } + else + { + larger_result = + (UNIT *) realloc (result, new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail; + } + } + result = larger_result; + allocated = new_allocated; { int ret = U_UCTOMB (result + length, muc, allocated - length); if (ret == -1) @@ -297,69 +344,15 @@ FUNC (const UNIT *s, size_t n, errno = EINVAL; goto fail; } - if (ret >= 0) - { - length += ret; - goto done_appending; - } - } - { - size_t old_allocated = allocated; - size_t new_allocated = 2 * old_allocated; - if (new_allocated < 64) - new_allocated = 64; - if (new_allocated < old_allocated) /* integer overflow? */ - abort (); - { - UNIT *larger_result; - if (result == NULL) - { - larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); - if (larger_result == NULL) - { - errno = ENOMEM; - goto fail; - } - } - else if (result == resultbuf) - { - larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); - if (larger_result == NULL) - { - errno = ENOMEM; - goto fail; - } - U_CPY (larger_result, resultbuf, length); - } - else - { - larger_result = - (UNIT *) realloc (result, new_allocated * sizeof (UNIT)); - if (larger_result == NULL) - { - errno = ENOMEM; - goto fail; - } - } - result = larger_result; - allocated = new_allocated; - { - int ret = U_UCTOMB (result + length, muc, allocated - length); - if (ret == -1) - { - errno = EINVAL; - goto fail; - } - if (ret < 0) - abort (); - length += ret; - goto done_appending; - } + if (ret < 0) + abort (); + length += ret; + goto done_appending; } } - done_appending: ; } - } + done_appending: ; + } if (!uc_is_case_ignorable (uc)) last_char_except_ignorable = uc; @@ -377,9 +370,8 @@ FUNC (const UNIT *s, size_t n, if (nf != NULL) { /* Finally, normalize the result. */ - UNIT *normalized_result; - - normalized_result = U_NORMALIZE (nf, result, length, resultbuf, lengthp); + UNIT *normalized_result = + U_NORMALIZE (nf, result, length, resultbuf, lengthp); if (normalized_result == NULL) goto fail; @@ -403,9 +395,7 @@ FUNC (const UNIT *s, size_t n, else if (result != resultbuf && length < allocated) { /* Shrink the allocated memory if possible. */ - UNIT *memory; - - memory = (UNIT *) realloc (result, length * sizeof (UNIT)); + UNIT *memory = (UNIT *) realloc (result, length * sizeof (UNIT)); if (memory != NULL) result = memory; } diff --git a/lib/unicase/u-casexfrm.h b/lib/unicase/u-casexfrm.h index 2c382973..f9195c7f 100644 --- a/lib/unicase/u-casexfrm.h +++ b/lib/unicase/u-casexfrm.h @@ -1,6 +1,6 @@ /* Locale dependent transformation for case insensitive comparison of Unicode strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -28,28 +28,22 @@ char * FUNC (const UNIT *s, size_t n, const char *iso639_language, uninorm_t nf, char *resultbuf, size_t *lengthp) { - UNIT foldedsbuf[2048 / sizeof (UNIT)]; - UNIT *foldeds; - size_t foldeds_length; - char convsbuf[2048]; - char *convs; - size_t convs_length; - char *result; - /* Casefold and normalize the Unicode string. */ - foldeds_length = sizeof (foldedsbuf) / sizeof (UNIT); - foldeds = U_CASEFOLD (s, n, iso639_language, nf, foldedsbuf, &foldeds_length); + UNIT foldedsbuf[2048 / sizeof (UNIT)]; + size_t foldeds_length = sizeof (foldedsbuf) / sizeof (UNIT); + UNIT *foldeds = U_CASEFOLD (s, n, iso639_language, nf, foldedsbuf, &foldeds_length); if (foldeds == NULL) /* errno is set here. */ return NULL; /* Convert it to locale encoding. */ - convs_length = sizeof (convsbuf) - 1; - convs = U_CONV_TO_ENCODING (locale_charset (), - iconveh_error, - foldeds, foldeds_length, - NULL, - convsbuf, &convs_length); + char convsbuf[2048]; + size_t convs_length = sizeof (convsbuf) - 1; + char *convs = U_CONV_TO_ENCODING (locale_charset (), + iconveh_error, + foldeds, foldeds_length, + NULL, + convsbuf, &convs_length); if (convs == NULL) { if (foldeds != foldedsbuf) @@ -78,7 +72,7 @@ FUNC (const UNIT *s, size_t n, const char *iso639_language, uninorm_t nf, } /* Apply locale dependent transformations for comparison. */ - result = amemxfrm (convs, convs_length, resultbuf, lengthp); + char *result = amemxfrm (convs, convs_length, resultbuf, lengthp); if (result == NULL) { if (convs != convsbuf) diff --git a/lib/unicase/u-ct-casefold.h b/lib/unicase/u-ct-casefold.h index 2ee011fb..c2801e39 100644 --- a/lib/unicase/u-ct-casefold.h +++ b/lib/unicase/u-ct-casefold.h @@ -1,5 +1,5 @@ /* Casefolding mapping for Unicode substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -53,27 +53,23 @@ FUNC (const UNIT *s, size_t n, /* X -> nf(toCasefold(NFD(X))) or X -> nf(toCasefold(nfd(toCasefold(NFD(X))))) */ int repeat = (uninorm_is_compat_decomposing (nf) ? 2 : 1); - UNIT tmpbuf1[2048 / sizeof (UNIT)]; - UNIT tmpbuf2[2048 / sizeof (UNIT)]; - UNIT *tmp1; - size_t tmp1_length; - UNIT *tmp2; - size_t tmp2_length; - tmp1_length = sizeof (tmpbuf1) / sizeof (UNIT); - tmp1 = U_NORMALIZE (UNINORM_NFD, s, n, tmpbuf1, &tmp1_length); + UNIT tmpbuf1[2048 / sizeof (UNIT)]; + size_t tmp1_length = sizeof (tmpbuf1) / sizeof (UNIT); + UNIT *tmp1 = U_NORMALIZE (UNINORM_NFD, s, n, tmpbuf1, &tmp1_length); if (tmp1 == NULL) /* errno is set here. */ return NULL; do { - tmp2_length = sizeof (tmpbuf2) / sizeof (UNIT); - tmp2 = U_CASEMAP (tmp1, tmp1_length, - prefix_context, suffix_context, iso639_language, - uc_tocasefold, offsetof (struct special_casing_rule, casefold[0]), - NULL, - tmpbuf2, &tmp2_length); + UNIT tmpbuf2[2048 / sizeof (UNIT)]; + size_t tmp2_length = sizeof (tmpbuf2) / sizeof (UNIT); + UNIT *tmp2 = U_CASEMAP (tmp1, tmp1_length, + prefix_context, suffix_context, iso639_language, + uc_tocasefold, offsetof (struct special_casing_rule, casefold[0]), + NULL, + tmpbuf2, &tmp2_length); if (tmp2 == NULL) { int saved_errno = errno; diff --git a/lib/unicase/u-ct-totitle.h b/lib/unicase/u-ct-totitle.h index b670f518..803636c5 100644 --- a/lib/unicase/u-ct-totitle.h +++ b/lib/unicase/u-ct-totitle.h @@ -1,5 +1,5 @@ /* Titlecase mapping for UTF-8/UTF-16/UTF-32 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -40,12 +40,7 @@ FUNC (const UNIT *s, size_t n, { /* The result being accumulated. */ UNIT *result; - size_t length; size_t allocated; - /* An array containing the word break positions. */ - char *wordbreaks; - - /* Initialize the accumulator. */ if (nf != NULL || resultbuf == NULL) { result = NULL; @@ -56,8 +51,10 @@ FUNC (const UNIT *s, size_t n, result = resultbuf; allocated = *lengthp; } - length = 0; + size_t length = 0; + /* An array containing the word break positions. */ + char *wordbreaks; /* Initialize the word breaks array. */ if (n > 0) { @@ -102,16 +99,13 @@ FUNC (const UNIT *s, size_t n, ucs4_t uc; int count = U_MBTOUC_UNSAFE (&uc, s, s_end - s); - ucs4_t (*single_character_map) (ucs4_t); - size_t offset_in_rule; /* offset in 'struct special_casing_rule' */ - - ucs4_t mapped_uc[3]; - unsigned int mapped_count; - if (*wp) /* Crossing a word boundary. */ in_word_first_part = true; + ucs4_t (*single_character_map) (ucs4_t); + size_t offset_in_rule; /* offset in 'struct special_casing_rule' */ + /* Determine single_character_map, offset_in_rule. There are three possibilities: - uc should not be converted. @@ -140,6 +134,9 @@ FUNC (const UNIT *s, size_t n, offset_in_rule = offsetof (struct special_casing_rule, lower[0]); } + ucs4_t mapped_uc[3]; + unsigned int mapped_count; + /* Actually map uc. */ if (single_character_map == NULL) { @@ -173,10 +170,11 @@ FUNC (const UNIT *s, size_t n, { /* Does the context apply? */ int context = rule->context; - bool applies; if (context < 0) context = - context; + + bool applies; switch (context) { case SCC_ALWAYS: @@ -357,15 +355,65 @@ FUNC (const UNIT *s, size_t n, found_mapping: /* Found the mapping: uc maps to mapped_uc[0..mapped_count-1]. */ - { - unsigned int i; + for (unsigned int i = 0; i < mapped_count; i++) + { + ucs4_t muc = mapped_uc[i]; - for (i = 0; i < mapped_count; i++) + /* Append muc to the result accumulator. */ + if (length < allocated) + { + int ret = U_UCTOMB (result + length, muc, allocated - length); + if (ret == -1) + { + errno = EINVAL; + goto fail1; + } + if (ret >= 0) + { + length += ret; + goto done_appending; + } + } { - ucs4_t muc = mapped_uc[i]; - - /* Append muc to the result accumulator. */ - if (length < allocated) + size_t old_allocated = allocated; + size_t new_allocated = 2 * old_allocated; + if (new_allocated < 64) + new_allocated = 64; + if (new_allocated < old_allocated) /* integer overflow? */ + abort (); + { + UNIT *larger_result; + if (result == NULL) + { + larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail1; + } + } + else if (result == resultbuf) + { + larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail1; + } + U_CPY (larger_result, resultbuf, length); + } + else + { + larger_result = + (UNIT *) realloc (result, new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail1; + } + } + result = larger_result; + allocated = new_allocated; { int ret = U_UCTOMB (result + length, muc, allocated - length); if (ret == -1) @@ -373,69 +421,15 @@ FUNC (const UNIT *s, size_t n, errno = EINVAL; goto fail1; } - if (ret >= 0) - { - length += ret; - goto done_appending; - } - } - { - size_t old_allocated = allocated; - size_t new_allocated = 2 * old_allocated; - if (new_allocated < 64) - new_allocated = 64; - if (new_allocated < old_allocated) /* integer overflow? */ - abort (); - { - UNIT *larger_result; - if (result == NULL) - { - larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); - if (larger_result == NULL) - { - errno = ENOMEM; - goto fail1; - } - } - else if (result == resultbuf) - { - larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); - if (larger_result == NULL) - { - errno = ENOMEM; - goto fail1; - } - U_CPY (larger_result, resultbuf, length); - } - else - { - larger_result = - (UNIT *) realloc (result, new_allocated * sizeof (UNIT)); - if (larger_result == NULL) - { - errno = ENOMEM; - goto fail1; - } - } - result = larger_result; - allocated = new_allocated; - { - int ret = U_UCTOMB (result + length, muc, allocated - length); - if (ret == -1) - { - errno = EINVAL; - goto fail1; - } - if (ret < 0) - abort (); - length += ret; - goto done_appending; - } + if (ret < 0) + abort (); + length += ret; + goto done_appending; } } - done_appending: ; } - } + done_appending: ; + } if (!uc_is_case_ignorable (uc)) last_char_except_ignorable = uc; @@ -456,9 +450,8 @@ FUNC (const UNIT *s, size_t n, if (nf != NULL) { /* Finally, normalize the result. */ - UNIT *normalized_result; - - normalized_result = U_NORMALIZE (nf, result, length, resultbuf, lengthp); + UNIT *normalized_result = + U_NORMALIZE (nf, result, length, resultbuf, lengthp); if (normalized_result == NULL) goto fail2; @@ -482,9 +475,7 @@ FUNC (const UNIT *s, size_t n, else if (result != resultbuf && length < allocated) { /* Shrink the allocated memory if possible. */ - UNIT *memory; - - memory = (UNIT *) realloc (result, length * sizeof (UNIT)); + UNIT *memory = (UNIT *) realloc (result, length * sizeof (UNIT)); if (memory != NULL) result = memory; } diff --git a/lib/unicase/u-is-cased.h b/lib/unicase/u-is-cased.h index a86d9b8f..faddbb74 100644 --- a/lib/unicase/u-is-cased.h +++ b/lib/unicase/u-is-cased.h @@ -1,5 +1,5 @@ /* Test whether case matters for a Unicode string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -27,27 +27,20 @@ int FUNC (const UNIT *s, size_t n, const char *iso639_language, bool *resultp) { - UNIT normsbuf[2048 / sizeof (UNIT)]; - UNIT *norms; - size_t norms_length; - UNIT mappedbuf[2048 / sizeof (UNIT)]; - UNIT *mapped_toupper; - UNIT *mapped_tolower; - UNIT *mapped_totitle; - size_t mapped_length; - /* Apply canonical decomposition to S. */ - norms_length = sizeof (normsbuf) / sizeof (UNIT); - norms = U_NORMALIZE (UNINORM_NFD, s, n, normsbuf, &norms_length); + UNIT normsbuf[2048 / sizeof (UNIT)]; + size_t norms_length = sizeof (normsbuf) / sizeof (UNIT); + UNIT *norms = U_NORMALIZE (UNINORM_NFD, s, n, normsbuf, &norms_length); if (norms == NULL) /* errno is set here. */ return -1; - mapped_length = sizeof (mappedbuf) / sizeof (UNIT); + UNIT mappedbuf[2048 / sizeof (UNIT)]; + size_t mapped_length = sizeof (mappedbuf) / sizeof (UNIT); /* Apply toupper mapping. */ - mapped_toupper = U_TOUPPER (norms, norms_length, iso639_language, NULL, - mappedbuf, &mapped_length); + UNIT *mapped_toupper = U_TOUPPER (norms, norms_length, iso639_language, NULL, + mappedbuf, &mapped_length); if (mapped_toupper == NULL) goto fail; @@ -61,8 +54,8 @@ FUNC (const UNIT *s, size_t n, const char *iso639_language, } /* Apply tolower mapping. */ - mapped_tolower = U_TOLOWER (norms, norms_length, iso639_language, NULL, - mapped_toupper, &mapped_length); + UNIT *mapped_tolower = U_TOLOWER (norms, norms_length, iso639_language, NULL, + mapped_toupper, &mapped_length); if (mapped_tolower == NULL) { if (mapped_toupper != mappedbuf) @@ -87,8 +80,8 @@ FUNC (const UNIT *s, size_t n, const char *iso639_language, } /* Apply totitle mapping. */ - mapped_totitle = U_TOTITLE (norms, norms_length, iso639_language, NULL, - mapped_tolower, &mapped_length); + UNIT *mapped_totitle = U_TOTITLE (norms, norms_length, iso639_language, NULL, + mapped_tolower, &mapped_length); if (mapped_totitle == NULL) { if (mapped_tolower != mappedbuf) diff --git a/lib/unicase/u-is-invariant.h b/lib/unicase/u-is-invariant.h index 2301b7f6..c859b4e5 100644 --- a/lib/unicase/u-is-invariant.h +++ b/lib/unicase/u-is-invariant.h @@ -1,5 +1,5 @@ /* Test whether a Unicode string is invariant under a given case mapping. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -31,24 +31,19 @@ FUNC (const UNIT *s, size_t n, const char *iso639_language, bool *resultp) { - UNIT normsbuf[2048 / sizeof (UNIT)]; - UNIT *norms; - size_t norms_length; - UNIT mappedbuf[2048 / sizeof (UNIT)]; - UNIT *mapped; - size_t mapped_length; - /* Apply canonical decomposition to S. */ - norms_length = sizeof (normsbuf) / sizeof (UNIT); - norms = U_NORMALIZE (UNINORM_NFD, s, n, normsbuf, &norms_length); + UNIT normsbuf[2048 / sizeof (UNIT)]; + size_t norms_length = sizeof (normsbuf) / sizeof (UNIT); + UNIT *norms = U_NORMALIZE (UNINORM_NFD, s, n, normsbuf, &norms_length); if (norms == NULL) /* errno is set here. */ return -1; /* Apply mapping. */ - mapped_length = sizeof (mappedbuf) / sizeof (UNIT); - mapped = mapping (norms, norms_length, iso639_language, NULL, - mappedbuf, &mapped_length); + UNIT mappedbuf[2048 / sizeof (UNIT)]; + size_t mapped_length = sizeof (mappedbuf) / sizeof (UNIT); + UNIT *mapped = mapping (norms, norms_length, iso639_language, NULL, + mappedbuf, &mapped_length); if (mapped == NULL) { if (norms != normsbuf) diff --git a/lib/unicase/u-prefix-context.h b/lib/unicase/u-prefix-context.h index b69fd5a0..80598269 100644 --- a/lib/unicase/u-prefix-context.h +++ b/lib/unicase/u-prefix-context.h @@ -1,5 +1,5 @@ /* Case-mapping context of prefix UTF-8/UTF-16/UTF-32 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u-suffix-context.h b/lib/unicase/u-suffix-context.h index 173d32d0..792adff5 100644 --- a/lib/unicase/u-suffix-context.h +++ b/lib/unicase/u-suffix-context.h @@ -1,5 +1,5 @@ /* Case-mapping context of suffix UTF-8/UTF-16/UTF-32 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u-totitle.h b/lib/unicase/u-totitle.h index effa1a16..e39d1954 100644 --- a/lib/unicase/u-totitle.h +++ b/lib/unicase/u-totitle.h @@ -1,5 +1,5 @@ /* Titlecase mapping for UTF-8/UTF-16/UTF-32 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-casecmp.c b/lib/unicase/u16-casecmp.c index 6f6a8a38..d98dd4ce 100644 --- a/lib/unicase/u16-casecmp.c +++ b/lib/unicase/u16-casecmp.c @@ -1,5 +1,5 @@ /* Case and normalization insensitive comparison of UTF-16 strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-casecoll.c b/lib/unicase/u16-casecoll.c index 085eebbb..ae9bada9 100644 --- a/lib/unicase/u16-casecoll.c +++ b/lib/unicase/u16-casecoll.c @@ -1,6 +1,6 @@ /* Locale dependent, case and normalization insensitive comparison of UTF-16 strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-casefold.c b/lib/unicase/u16-casefold.c index e5eca52e..ca9a7a79 100644 --- a/lib/unicase/u16-casefold.c +++ b/lib/unicase/u16-casefold.c @@ -1,5 +1,5 @@ /* Casefolding mapping for UTF-16 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-casemap.c b/lib/unicase/u16-casemap.c index a01944e5..47b210c0 100644 --- a/lib/unicase/u16-casemap.c +++ b/lib/unicase/u16-casemap.c @@ -1,5 +1,5 @@ /* Case mapping for UTF-16 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-casexfrm.c b/lib/unicase/u16-casexfrm.c index 530d988c..ffdb805e 100644 --- a/lib/unicase/u16-casexfrm.c +++ b/lib/unicase/u16-casexfrm.c @@ -1,6 +1,6 @@ /* Locale dependent transformation for case insensitive comparison of UTF-16 strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-ct-casefold.c b/lib/unicase/u16-ct-casefold.c index f043a1ed..fb50cd17 100644 --- a/lib/unicase/u16-ct-casefold.c +++ b/lib/unicase/u16-ct-casefold.c @@ -1,5 +1,5 @@ /* Casefolding mapping for UTF-16 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-ct-tolower.c b/lib/unicase/u16-ct-tolower.c index 5e301ddf..6ef80c6a 100644 --- a/lib/unicase/u16-ct-tolower.c +++ b/lib/unicase/u16-ct-tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for UTF-16 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-ct-totitle.c b/lib/unicase/u16-ct-totitle.c index b594d6e3..bf4a38f4 100644 --- a/lib/unicase/u16-ct-totitle.c +++ b/lib/unicase/u16-ct-totitle.c @@ -1,5 +1,5 @@ /* Titlecase mapping for UTF-16 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-ct-toupper.c b/lib/unicase/u16-ct-toupper.c index 3599a29d..fb4a9459 100644 --- a/lib/unicase/u16-ct-toupper.c +++ b/lib/unicase/u16-ct-toupper.c @@ -1,5 +1,5 @@ /* Uppercase mapping for UTF-16 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-is-cased.c b/lib/unicase/u16-is-cased.c index 9288050e..92851fe8 100644 --- a/lib/unicase/u16-is-cased.c +++ b/lib/unicase/u16-is-cased.c @@ -1,5 +1,5 @@ /* Test whether case matters for an UTF-16 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-is-casefolded.c b/lib/unicase/u16-is-casefolded.c index 2bf47724..d7c34d31 100644 --- a/lib/unicase/u16-is-casefolded.c +++ b/lib/unicase/u16-is-casefolded.c @@ -1,5 +1,5 @@ /* Test whether an UTF-16 string is already case-folded. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-is-invariant.c b/lib/unicase/u16-is-invariant.c index 676a2ed6..7b44c054 100644 --- a/lib/unicase/u16-is-invariant.c +++ b/lib/unicase/u16-is-invariant.c @@ -1,5 +1,5 @@ /* Test whether an UTF-16 string is invariant under a given case mapping. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-is-lowercase.c b/lib/unicase/u16-is-lowercase.c index 058c0501..d4ed1939 100644 --- a/lib/unicase/u16-is-lowercase.c +++ b/lib/unicase/u16-is-lowercase.c @@ -1,5 +1,5 @@ /* Test whether an UTF-16 string is entirely lower case. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-is-titlecase.c b/lib/unicase/u16-is-titlecase.c index 5110b7e8..a911bd53 100644 --- a/lib/unicase/u16-is-titlecase.c +++ b/lib/unicase/u16-is-titlecase.c @@ -1,5 +1,5 @@ /* Test whether an UTF-16 string is entirely title case. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-is-uppercase.c b/lib/unicase/u16-is-uppercase.c index 60a722f6..a8f5865f 100644 --- a/lib/unicase/u16-is-uppercase.c +++ b/lib/unicase/u16-is-uppercase.c @@ -1,5 +1,5 @@ /* Test whether an UTF-16 string is entirely upper case. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-prefix-context.c b/lib/unicase/u16-prefix-context.c index e668af9b..ec67e0f5 100644 --- a/lib/unicase/u16-prefix-context.c +++ b/lib/unicase/u16-prefix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of prefix UTF-16 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-suffix-context.c b/lib/unicase/u16-suffix-context.c index e0845b7b..b6cfe6e4 100644 --- a/lib/unicase/u16-suffix-context.c +++ b/lib/unicase/u16-suffix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of suffix UTF-16 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-tolower.c b/lib/unicase/u16-tolower.c index b440edde..b3a3b1db 100644 --- a/lib/unicase/u16-tolower.c +++ b/lib/unicase/u16-tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for UTF-16 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-totitle.c b/lib/unicase/u16-totitle.c index 49e9fe0e..5b4da8fb 100644 --- a/lib/unicase/u16-totitle.c +++ b/lib/unicase/u16-totitle.c @@ -1,5 +1,5 @@ /* Titlecase mapping for UTF-16 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u16-toupper.c b/lib/unicase/u16-toupper.c index 14fc1962..e1f2635a 100644 --- a/lib/unicase/u16-toupper.c +++ b/lib/unicase/u16-toupper.c @@ -1,5 +1,5 @@ /* Uppercase mapping for UTF-16 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-casecmp.c b/lib/unicase/u32-casecmp.c index fa2497d2..6898823c 100644 --- a/lib/unicase/u32-casecmp.c +++ b/lib/unicase/u32-casecmp.c @@ -1,5 +1,5 @@ /* Case and normalization insensitive comparison of UTF-32 strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-casecoll.c b/lib/unicase/u32-casecoll.c index f328d4bd..f43119ce 100644 --- a/lib/unicase/u32-casecoll.c +++ b/lib/unicase/u32-casecoll.c @@ -1,6 +1,6 @@ /* Locale dependent, case and normalization insensitive comparison of UTF-32 strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-casefold.c b/lib/unicase/u32-casefold.c index c4ae6f49..f54fd9d0 100644 --- a/lib/unicase/u32-casefold.c +++ b/lib/unicase/u32-casefold.c @@ -1,5 +1,5 @@ /* Casefolding mapping for UTF-32 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-casemap.c b/lib/unicase/u32-casemap.c index 51704d3e..4f1161b5 100644 --- a/lib/unicase/u32-casemap.c +++ b/lib/unicase/u32-casemap.c @@ -1,5 +1,5 @@ /* Case mapping for UTF-32 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-casexfrm.c b/lib/unicase/u32-casexfrm.c index da0374c8..85396426 100644 --- a/lib/unicase/u32-casexfrm.c +++ b/lib/unicase/u32-casexfrm.c @@ -1,6 +1,6 @@ /* Locale dependent transformation for case insensitive comparison of UTF-32 strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-ct-casefold.c b/lib/unicase/u32-ct-casefold.c index 790e20a2..5ea1ee74 100644 --- a/lib/unicase/u32-ct-casefold.c +++ b/lib/unicase/u32-ct-casefold.c @@ -1,5 +1,5 @@ /* Casefolding mapping for UTF-32 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-ct-tolower.c b/lib/unicase/u32-ct-tolower.c index 0892b62a..95834829 100644 --- a/lib/unicase/u32-ct-tolower.c +++ b/lib/unicase/u32-ct-tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for UTF-32 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-ct-totitle.c b/lib/unicase/u32-ct-totitle.c index e6c8d4e3..6f93f008 100644 --- a/lib/unicase/u32-ct-totitle.c +++ b/lib/unicase/u32-ct-totitle.c @@ -1,5 +1,5 @@ /* Titlecase mapping for UTF-32 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-ct-toupper.c b/lib/unicase/u32-ct-toupper.c index b39940da..f457f49b 100644 --- a/lib/unicase/u32-ct-toupper.c +++ b/lib/unicase/u32-ct-toupper.c @@ -1,5 +1,5 @@ /* Uppercase mapping for UTF-32 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-is-cased.c b/lib/unicase/u32-is-cased.c index 02fc45c1..14500c97 100644 --- a/lib/unicase/u32-is-cased.c +++ b/lib/unicase/u32-is-cased.c @@ -1,5 +1,5 @@ /* Test whether case matters for an UTF-32 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-is-casefolded.c b/lib/unicase/u32-is-casefolded.c index ea6d8226..a1a4ae0f 100644 --- a/lib/unicase/u32-is-casefolded.c +++ b/lib/unicase/u32-is-casefolded.c @@ -1,5 +1,5 @@ /* Test whether an UTF-32 string is already case-folded. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-is-invariant.c b/lib/unicase/u32-is-invariant.c index e30c1aaf..312d0504 100644 --- a/lib/unicase/u32-is-invariant.c +++ b/lib/unicase/u32-is-invariant.c @@ -1,5 +1,5 @@ /* Test whether an UTF-32 string is invariant under a given case mapping. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-is-lowercase.c b/lib/unicase/u32-is-lowercase.c index f02a93a2..494ef976 100644 --- a/lib/unicase/u32-is-lowercase.c +++ b/lib/unicase/u32-is-lowercase.c @@ -1,5 +1,5 @@ /* Test whether an UTF-32 string is entirely lower case. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-is-titlecase.c b/lib/unicase/u32-is-titlecase.c index a3ecd6ab..12162c34 100644 --- a/lib/unicase/u32-is-titlecase.c +++ b/lib/unicase/u32-is-titlecase.c @@ -1,5 +1,5 @@ /* Test whether an UTF-32 string is entirely title case. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-is-uppercase.c b/lib/unicase/u32-is-uppercase.c index 6b3f9000..95ea76f0 100644 --- a/lib/unicase/u32-is-uppercase.c +++ b/lib/unicase/u32-is-uppercase.c @@ -1,5 +1,5 @@ /* Test whether an UTF-32 string is entirely upper case. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-prefix-context.c b/lib/unicase/u32-prefix-context.c index d2f25f21..8e2da09b 100644 --- a/lib/unicase/u32-prefix-context.c +++ b/lib/unicase/u32-prefix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of prefix UTF-32 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-suffix-context.c b/lib/unicase/u32-suffix-context.c index aed6a74a..2849111d 100644 --- a/lib/unicase/u32-suffix-context.c +++ b/lib/unicase/u32-suffix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of suffix UTF-32 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-tolower.c b/lib/unicase/u32-tolower.c index 85c1f9e4..3c75471e 100644 --- a/lib/unicase/u32-tolower.c +++ b/lib/unicase/u32-tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for UTF-32 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-totitle.c b/lib/unicase/u32-totitle.c index ba3c0343..918f5814 100644 --- a/lib/unicase/u32-totitle.c +++ b/lib/unicase/u32-totitle.c @@ -1,5 +1,5 @@ /* Titlecase mapping for UTF-32 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u32-toupper.c b/lib/unicase/u32-toupper.c index abf900db..1ec20b43 100644 --- a/lib/unicase/u32-toupper.c +++ b/lib/unicase/u32-toupper.c @@ -1,5 +1,5 @@ /* Uppercase mapping for UTF-32 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-casecmp.c b/lib/unicase/u8-casecmp.c index 86e165b0..4aa61d55 100644 --- a/lib/unicase/u8-casecmp.c +++ b/lib/unicase/u8-casecmp.c @@ -1,5 +1,5 @@ /* Case and normalization insensitive comparison of UTF-8 strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-casecoll.c b/lib/unicase/u8-casecoll.c index 56847c63..cd9d42d4 100644 --- a/lib/unicase/u8-casecoll.c +++ b/lib/unicase/u8-casecoll.c @@ -1,6 +1,6 @@ /* Locale dependent, case and normalization insensitive comparison of UTF-8 strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-casefold.c b/lib/unicase/u8-casefold.c index 918f6163..d446855c 100644 --- a/lib/unicase/u8-casefold.c +++ b/lib/unicase/u8-casefold.c @@ -1,5 +1,5 @@ /* Casefolding mapping for UTF-8 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -50,7 +50,6 @@ read_file (FILE *stream) char *buf = NULL; int alloc = 0; int size = 0; - int count; while (! feof (stream)) { @@ -66,7 +65,7 @@ read_file (FILE *stream) exit (1); } } - count = fread (buf + size, 1, BUFSIZE, stream); + int count = fread (buf + size, 1, BUFSIZE, stream); if (count == 0) { if (ferror (stream)) diff --git a/lib/unicase/u8-casemap.c b/lib/unicase/u8-casemap.c index b94f5096..780fbbf3 100644 --- a/lib/unicase/u8-casemap.c +++ b/lib/unicase/u8-casemap.c @@ -1,5 +1,5 @@ /* Case mapping for UTF-8 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-casexfrm.c b/lib/unicase/u8-casexfrm.c index 259b9114..f88f1a0c 100644 --- a/lib/unicase/u8-casexfrm.c +++ b/lib/unicase/u8-casexfrm.c @@ -1,6 +1,6 @@ /* Locale dependent transformation for case insensitive comparison of UTF-8 strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-ct-casefold.c b/lib/unicase/u8-ct-casefold.c index ca3fe93e..d132af19 100644 --- a/lib/unicase/u8-ct-casefold.c +++ b/lib/unicase/u8-ct-casefold.c @@ -1,5 +1,5 @@ /* Casefolding mapping for UTF-8 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-ct-tolower.c b/lib/unicase/u8-ct-tolower.c index b7500d25..93412107 100644 --- a/lib/unicase/u8-ct-tolower.c +++ b/lib/unicase/u8-ct-tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for UTF-8 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-ct-totitle.c b/lib/unicase/u8-ct-totitle.c index d321bacf..ae4a123f 100644 --- a/lib/unicase/u8-ct-totitle.c +++ b/lib/unicase/u8-ct-totitle.c @@ -1,5 +1,5 @@ /* Titlecase mapping for UTF-8 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-ct-toupper.c b/lib/unicase/u8-ct-toupper.c index 9e18bf42..1d4ee155 100644 --- a/lib/unicase/u8-ct-toupper.c +++ b/lib/unicase/u8-ct-toupper.c @@ -1,5 +1,5 @@ /* Uppercase mapping for UTF-8 substrings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-is-cased.c b/lib/unicase/u8-is-cased.c index 5a3012a8..e84ae088 100644 --- a/lib/unicase/u8-is-cased.c +++ b/lib/unicase/u8-is-cased.c @@ -1,5 +1,5 @@ /* Test whether case matters for an UTF-8 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-is-casefolded.c b/lib/unicase/u8-is-casefolded.c index acdd1225..c242922b 100644 --- a/lib/unicase/u8-is-casefolded.c +++ b/lib/unicase/u8-is-casefolded.c @@ -1,5 +1,5 @@ /* Test whether an UTF-8 string is already case-folded. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-is-invariant.c b/lib/unicase/u8-is-invariant.c index d30164bd..11392017 100644 --- a/lib/unicase/u8-is-invariant.c +++ b/lib/unicase/u8-is-invariant.c @@ -1,5 +1,5 @@ /* Test whether an UTF-8 string is invariant under a given case mapping. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-is-lowercase.c b/lib/unicase/u8-is-lowercase.c index 2e813ce1..62ed1626 100644 --- a/lib/unicase/u8-is-lowercase.c +++ b/lib/unicase/u8-is-lowercase.c @@ -1,5 +1,5 @@ /* Test whether an UTF-8 string is entirely lower case. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-is-titlecase.c b/lib/unicase/u8-is-titlecase.c index 6e88557b..0d7ff162 100644 --- a/lib/unicase/u8-is-titlecase.c +++ b/lib/unicase/u8-is-titlecase.c @@ -1,5 +1,5 @@ /* Test whether an UTF-8 string is entirely title case. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-is-uppercase.c b/lib/unicase/u8-is-uppercase.c index 28eaaeff..d177cf71 100644 --- a/lib/unicase/u8-is-uppercase.c +++ b/lib/unicase/u8-is-uppercase.c @@ -1,5 +1,5 @@ /* Test whether an UTF-8 string is entirely upper case. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-prefix-context.c b/lib/unicase/u8-prefix-context.c index 997214b3..1111b628 100644 --- a/lib/unicase/u8-prefix-context.c +++ b/lib/unicase/u8-prefix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of prefix UTF-8 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-suffix-context.c b/lib/unicase/u8-suffix-context.c index 66acf564..1ff29488 100644 --- a/lib/unicase/u8-suffix-context.c +++ b/lib/unicase/u8-suffix-context.c @@ -1,5 +1,5 @@ /* Case-mapping context of suffix UTF-8 string. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/u8-tolower.c b/lib/unicase/u8-tolower.c index 2ec21ade..cc4bc036 100644 --- a/lib/unicase/u8-tolower.c +++ b/lib/unicase/u8-tolower.c @@ -1,5 +1,5 @@ /* Lowercase mapping for UTF-8 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -63,7 +63,6 @@ read_file (FILE *stream) char *buf = NULL; int alloc = 0; int size = 0; - int count; while (! feof (stream)) { @@ -79,7 +78,7 @@ read_file (FILE *stream) exit (1); } } - count = fread (buf + size, 1, BUFSIZE, stream); + int count = fread (buf + size, 1, BUFSIZE, stream); if (count == 0) { if (ferror (stream)) diff --git a/lib/unicase/u8-totitle.c b/lib/unicase/u8-totitle.c index 31862b13..2b0d3cf7 100644 --- a/lib/unicase/u8-totitle.c +++ b/lib/unicase/u8-totitle.c @@ -1,5 +1,5 @@ /* Titlecase mapping for UTF-8 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -50,7 +50,6 @@ read_file (FILE *stream) char *buf = NULL; int alloc = 0; int size = 0; - int count; while (! feof (stream)) { @@ -66,7 +65,7 @@ read_file (FILE *stream) exit (1); } } - count = fread (buf + size, 1, BUFSIZE, stream); + int count = fread (buf + size, 1, BUFSIZE, stream); if (count == 0) { if (ferror (stream)) diff --git a/lib/unicase/u8-toupper.c b/lib/unicase/u8-toupper.c index 064d735f..9dccf9d9 100644 --- a/lib/unicase/u8-toupper.c +++ b/lib/unicase/u8-toupper.c @@ -1,5 +1,5 @@ /* Uppercase mapping for UTF-8 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -63,7 +63,6 @@ read_file (FILE *stream) char *buf = NULL; int alloc = 0; int size = 0; - int count; while (! feof (stream)) { @@ -79,7 +78,7 @@ read_file (FILE *stream) exit (1); } } - count = fread (buf + size, 1, BUFSIZE, stream); + int count = fread (buf + size, 1, BUFSIZE, stream); if (count == 0) { if (ferror (stream)) diff --git a/lib/unicase/ulc-casecmp.c b/lib/unicase/ulc-casecmp.c index e10bea8f..3504addc 100644 --- a/lib/unicase/ulc-casecmp.c +++ b/lib/unicase/ulc-casecmp.c @@ -1,5 +1,5 @@ /* Case and normalization insensitive comparison of strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -41,14 +41,10 @@ ulc_u8_casefold (const char *s, size_t n, const char *iso639_language, uninorm_t nf, uint8_t *resultbuf, size_t *lengthp) { - uint8_t convbuf[2048 / sizeof (uint8_t)]; - uint8_t *conv; - size_t conv_length; - uint8_t *result; - /* Convert the string to UTF-8. */ - conv_length = sizeof (convbuf) / sizeof (uint8_t); - conv = + uint8_t convbuf[2048 / sizeof (uint8_t)]; + size_t conv_length = sizeof (convbuf) / sizeof (uint8_t); + uint8_t *conv = u8_conv_from_encoding (locale_charset (), iconveh_error, s, n, NULL, convbuf, &conv_length); if (conv == NULL) @@ -56,8 +52,8 @@ ulc_u8_casefold (const char *s, size_t n, const char *iso639_language, return NULL; /* Case-fold and normalize. */ - result = u8_casefold (conv, conv_length, iso639_language, nf, - resultbuf, lengthp); + uint8_t *result = u8_casefold (conv, conv_length, iso639_language, nf, + resultbuf, lengthp); if (result == NULL) { if (conv != convbuf) diff --git a/lib/unicase/ulc-casecoll.c b/lib/unicase/ulc-casecoll.c index ea4bdf16..9cbfbb6a 100644 --- a/lib/unicase/ulc-casecoll.c +++ b/lib/unicase/ulc-casecoll.c @@ -1,5 +1,5 @@ /* Locale dependent, case and normalization insensitive comparison of strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. diff --git a/lib/unicase/ulc-casexfrm.c b/lib/unicase/ulc-casexfrm.c index ce523c9d..ef27d2ad 100644 --- a/lib/unicase/ulc-casexfrm.c +++ b/lib/unicase/ulc-casexfrm.c @@ -1,5 +1,5 @@ /* Locale dependent transformation for case insensitive comparison of strings. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. @@ -38,14 +38,10 @@ ulc_casexfrm (const char *s, size_t n, const char *iso639_language, uninorm_t nf, char *resultbuf, size_t *lengthp) { - uint8_t convbuf[2048 / sizeof (uint8_t)]; - uint8_t *conv; - size_t conv_length; - char *result; - /* Convert the string to UTF-8. */ - conv_length = sizeof (convbuf) / sizeof (uint8_t); - conv = + uint8_t convbuf[2048 / sizeof (uint8_t)]; + size_t conv_length = sizeof (convbuf) / sizeof (uint8_t); + uint8_t *conv = u8_conv_from_encoding (locale_charset (), iconveh_error, s, n, NULL, convbuf, &conv_length); if (conv == NULL) @@ -53,8 +49,8 @@ ulc_casexfrm (const char *s, size_t n, const char *iso639_language, return NULL; /* Case-fold and normalize. */ - result = u8_casexfrm (conv, conv_length, iso639_language, nf, - resultbuf, lengthp); + char *result = u8_casexfrm (conv, conv_length, iso639_language, nf, + resultbuf, lengthp); if (result == NULL) { if (conv != convbuf) diff --git a/lib/unicase/unicasemap.h b/lib/unicase/unicasemap.h index 6783b9b3..ce80329e 100644 --- a/lib/unicase/unicasemap.h +++ b/lib/unicase/unicasemap.h @@ -1,5 +1,5 @@ /* Case mapping for UTF-8/UTF-16/UTF-32 strings (locale dependent). - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This file is free software. |
