* lib/gen-uni-tables.c (fill_attributes): Use str_endswith.
* lib/get-rusage-data.c (get_rusage_data_via_setrlimit): Likewise.
* lib/isatty.c (IsCygwinConsoleHandle): Likewise.
* modules/gen-uni-tables (Depends-on): Add str_endswith.
* modules/get-rusage-data (Depends-on): Likewise.
* modules/isatty (Depends-on): Likewise.
+2025-01-03 Bruno Haible <bruno@clisp.org>
+
+ gen-uni-tables, get-rusage-data, isatty: Use str_endswith.
+ * lib/gen-uni-tables.c (fill_attributes): Use str_endswith.
+ * lib/get-rusage-data.c (get_rusage_data_via_setrlimit): Likewise.
+ * lib/isatty.c (IsCygwinConsoleHandle): Likewise.
+ * modules/gen-uni-tables (Depends-on): Add str_endswith.
+ * modules/get-rusage-data (Depends-on): Likewise.
+ * modules/isatty (Depends-on): Likewise.
+
2025-01-03 Bruno Haible <bruno@clisp.org>
tests: Use str_startswith.
i = strtoul (field0, NULL, 16);
if (field1[0] == '<'
&& strlen (field1) >= 9
- && strcmp (field1 + strlen (field1) - 8, ", First>") == 0)
+ && str_endswith (field1, ", First>"))
{
/* Deal with a range. */
lineno++;
}
if (!(field1[0] == '<'
&& strlen (field1) >= 8
- && strcmp (field1 + strlen (field1) - 7, ", Last>") == 0))
+ && str_endswith (field1, ", Last>")))
{
fprintf (stderr, "missing end range in '%s':%d\n",
unicodedata_filename, lineno);
struct utsname buf;
if (uname (&buf) == 0
- && strlen (buf.release) >= 5
- && (strcmp (buf.release + strlen (buf.release) - 5, "11.00") == 0
- || strcmp (buf.release + strlen (buf.release) - 5, "11.11") == 0))
+ && (str_endswith (buf.release, "11.00")
+ || str_endswith (buf.release, "11.11")))
return 0;
}
# endif
or higher. */
if (QueryFullProcessImageNameFunc (processHandle, 0, buf, &bufsize))
{
- if (strlen (buf) >= 11
- && strcmp (buf + strlen (buf) - 11, "\\mintty.exe") == 0)
+ if (str_endswith (buf, "\\mintty.exe"))
result = TRUE;
}
CloseHandle (processHandle);
strdup
strstr-simple
str_startswith
+str_endswith
configure.ac:
AC_REQUIRE([AC_C_INLINE])
extensions
getpagesize
vma-iter
+str_endswith
configure.ac:
AC_CHECK_FUNCS_ONCE([sbrk setrlimit])
unistd-h
msvc-inval [test $REPLACE_ISATTY = 1]
msvc-nothrow [test $REPLACE_ISATTY = 1]
+str_endswith [test $REPLACE_ISATTY = 1]
configure.ac:
gl_FUNC_ISATTY