-
- d[j++] = '\'';
- d[j] = '\0';
-
- return j;
-}
-
-/* NULL-pointer aware string comparison functions */
-
-int mutt_strcmp(const char *a, const char *b)
-{
- return strcmp(NONULL(a), NONULL(b));
-}
-
-int mutt_strcasecmp(const char *a, const char *b)
-{
- return strcasecmp(NONULL(a), NONULL(b));
-}
-
-int mutt_strncmp(const char *a, const char *b, size_t l)
-{
- return strncmp(NONULL(a), NONULL(b), l);
-}
-
-int mutt_strncasecmp(const char *a, const char *b, size_t l)
-{
- return strncasecmp(NONULL(a), NONULL(b), l);
-}
-
-size_t mutt_strlen(const char *a)
-{
- return a ? strlen (a) : 0;
-}
-
-int mutt_strcoll(const char *a, const char *b)
-{
- return strcoll(NONULL(a), NONULL(b));
-}
-
-const char *mutt_stristr (const char *haystack, const char *needle)
-{
- const char *p, *q;
-
- if (!haystack)
- return NULL;
- if (!needle)
- return (haystack);
-
- while (*(p = haystack))
- {
- for (q = needle;
- *p && *q &&
- tolower ((unsigned char) *p) == tolower ((unsigned char) *q);
- p++, q++)
- ;
- if (!*q)
- return (haystack);
- haystack++;
- }
- return NULL;
-}