/* This function is equivalent to strcasecmp(). */
int nstrcasecmp(const char *s1, const char *s2)
{
- return
-#ifdef HAVE_STRNCASECMP
- strncasecmp(s1, s2, (size_t)-1);
-#else
- nstrncasecmp(s1, s2, (size_t)-1);
-#endif
+ return strncasecmp(s1, s2, (size_t)-1);
}
#endif
return (towlower(ws1) - towlower(ws2));
} else
#endif
- return
-#ifdef HAVE_STRNCASECMP
- strncasecmp(s1, s2, n);
-#else
- nstrncasecmp(s1, s2, n);
-#endif
+ return strncasecmp(s1, s2, n);
}
#ifndef HAVE_STRCASESTR
return found_needle ? haystack : NULL;
} else
#endif
- return
-#ifdef HAVE_STRCASESTR
- strcasestr(haystack, needle);
-#else
- nstrcasestr(haystack, needle);
-#endif
+ return strcasestr(haystack, needle);
}
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
return n;
} else
#endif
- return
-#ifdef HAVE_STRNLEN
- strnlen(s, maxlen);
-#else
- nstrnlen(s, maxlen);
-#endif
+ return strnlen(s, maxlen);
}
#ifndef DISABLE_JUSTIFY
#endif
#endif
-/* If no getdelim() or getline(), use the versions we have. */
+/* If no strcasecmp(), strncasecmp(), strcasestr(), strnlen(),
+ * getdelim(), or getline(), use the versions we have. */
+#ifndef HAVE_STRCASECMP
+#define strcasecmp nstrcasecmp
+#endif
+#ifndef HAVE_STRNCASECMP
+#define strncasecmp nstrncasecmp
+#endif
+#ifndef HAVE_STRCASESTR
+#define strcasestr nstrcasestr
+#endif
+#ifndef HAVE_STRNLEN
+#define strnlen nstrnlen
+#endif
#ifndef HAVE_GETDELIM
#define getdelim ngetdelim
#endif