+2026-02-20 Bruno Haible <bruno@clisp.org>
+
+ csharpcomp: Use str_endswith.
+ Suggested by Paul Eggert in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00129.html>.
+ * lib/csharpcomp.c (compile_csharp_using_mono,
+ compile_csharp_using_dotnet, compile_csharp_using_sscli,
+ compile_csharp_class): Use str_endswith.
+ * modules/csharpcomp (Depends-on): Add str_endswith.
+
2026-02-20 Bruno Haible <bruno@clisp.org>
i-ring: Relicense under LGPLv2+.
for (unsigned int i = 0; i < sources_count; i++)
{
const char *source_file = sources[i];
- if (strlen (source_file) >= 10
- && memeq (source_file + strlen (source_file) - 10,
- ".resources", 10))
+ if (str_endswith (source_file, ".resources"))
{
char *option = (char *) xmalloca (10 + strlen (source_file) + 1);
const char *source_file = sources[i];
char *source_file_converted = cygpath_w (source_file);
*mallocedp++ = source_file_converted;
- if (strlen (source_file_converted) >= 10
- && memeq ((source_file_converted
- + strlen (source_file_converted) - 10),
- ".resources", 10))
+ if (str_endswith (source_file_converted, ".resources"))
{
char *option =
(char *) xmalloc (10 + strlen (source_file_converted) + 1);
const char *source_file = sources[i];
char *source_file_converted = cygpath_w (source_file);
*mallocedp++ = source_file_converted;
- if (strlen (source_file_converted) >= 10
- && memeq ((source_file_converted
- + strlen (source_file_converted) - 10),
- ".resources", 10))
+ if (str_endswith (source_file_converted, ".resources"))
{
char *option =
(char *) xmalloc (10 + strlen (source_file_converted) + 1);
const char *source_file = sources[i];
char *source_file_converted = cygpath_w (source_file);
*mallocedp++ = source_file_converted;
- if (strlen (source_file_converted) >= 10
- && memeq ((source_file_converted
- + strlen (source_file_converted) - 10),
- ".resources", 10))
+ if (str_endswith (source_file_converted, ".resources"))
{
char *option =
(char *) xmalloc (10 + strlen (source_file_converted) + 1);
bool optimize, bool debug,
bool verbose)
{
- bool output_is_library =
- (strlen (output_file) >= 4
- && memeq (output_file + strlen (output_file) - 4, ".dll", 4));
+ bool output_is_library = str_endswith (output_file, ".dll");
int result;