commit ba2e6f43c284770eac121eb418c43414e8fde953
parent 6c555828c9b6d80a57ba5878b2a9dc7164d3a3d0
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 3 Jun 2018 17:47:02 +0200
tweaks: elide a subfunction that is used just once
(Forgot to say: the previous two commits addressed
https://savannah.gnu.org/bugs/?54044.)
Diffstat:
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/chars.c b/src/chars.c
@@ -530,15 +530,11 @@ char *mbrevstrcasestr(const char *haystack, const char *needle,
return revstrcasestr(haystack, needle, pointer);
}
-/* This function is equivalent to strlen() for multibyte strings. */
+/* Count the number of (multibyte) characters in the given string. */
size_t mbstrlen(const char *s)
{
- return mbstrnlen(s, (size_t)-1);
-}
+ size_t maxlen = (size_t)-1;
-/* This function is equivalent to strnlen() for multibyte strings. */
-size_t mbstrnlen(const char *s, size_t maxlen)
-{
#ifdef ENABLE_UTF8
if (use_utf8) {
size_t n = 0;
diff --git a/src/proto.h b/src/proto.h
@@ -222,7 +222,6 @@ char *mbstrcasestr(const char *haystack, const char *needle);
char *revstrstr(const char *haystack, const char *needle, const char *index);
char *mbrevstrcasestr(const char *haystack, const char *needle, const char *index);
size_t mbstrlen(const char *s);
-size_t mbstrnlen(const char *s, size_t maxlen);
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
char *mbstrchr(const char *s, const char *c);
#endif