tweaks: elide a subfunction that is used just once

(Forgot to say: the previous two commits addressed
https://savannah.gnu.org/bugs/?54044.)
master
Benno Schulenberg 2018-06-03 17:47:02 +02:00
parent 6c555828c9
commit ba2e6f43c2
2 changed files with 2 additions and 7 deletions

View File

@ -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;

View File

@ -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