]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
No need to check for or provide strcaststr() anymore. 15370/head
authorMiod Vallat <miod.vallat@powerdns.com>
Thu, 27 Mar 2025 07:58:47 +0000 (08:58 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Thu, 27 Mar 2025 08:01:39 +0000 (09:01 +0100)
configure.ac
meson/various-functions/meson.build
pdns/recursordist/configure.ac
pdns/ws-api.cc

index b0fec7b40b9f69ebcaef95ee9f2f4169c40f43f3..ae48b1cb7cc27a7faa5e74aa5f22a53339d93258 100644 (file)
@@ -148,7 +148,7 @@ PDNS_FROM_GIT
 dnl Checks for library functions.
 dnl the *_r functions are in posix so we can use them unconditionally, but the ext/yahttp code is
 dnl using the defines.
-AC_CHECK_FUNCS_ONCE([strcasestr localtime_r gmtime_r recvmmsg sched_setscheduler])
+AC_CHECK_FUNCS_ONCE([localtime_r gmtime_r recvmmsg sched_setscheduler])
 AC_CHECK_FUNCS_ONCE([getrandom getentropy arc4random arc4random_uniform arc4random_buf])
 PDNS_CHECK_SECURE_MEMSET
 
index 8c268d57202100012e2f88477aa7e70019c1be01..5137336c3008418d4788267b729079b78ef81e2a 100644 (file)
@@ -1,5 +1,4 @@
 funcs = [
-  'strcasestr',
   'localtime_r',
   'gmtime_r',
   'recvmmsg',
index 84432232fde0be130ace6045793d4f6b762ed3f4..db7d3cfbb20a847b99bc96d819ef54cb80352b6d 100644 (file)
@@ -105,7 +105,7 @@ PDNS_CHECK_CURL
 
 dnl the *_r functions are in posix so we can use them unconditionally, but the ext/yahttp code is
 dnl using the defines.
-AC_CHECK_FUNCS_ONCE([localtime_r gmtime_r strcasestr])
+AC_CHECK_FUNCS_ONCE([localtime_r gmtime_r])
 AC_CHECK_FUNCS_ONCE([getrandom getentropy arc4random arc4random_uniform arc4random_buf])
 PDNS_CHECK_SECURE_MEMSET
 
index 329e5aeba6e43f2aa85825cc32026c9581945d04..3c204ae31eeb20f01e8fa69978a011eda7987d12 100644 (file)
@@ -50,47 +50,6 @@ using json11::Json;
 extern StatBag S;
 #endif
 
-#ifndef HAVE_STRCASESTR
-
-/*
- * strcasestr() locates the first occurrence in the string s1 of the
- * sequence of characters (excluding the terminating null character)
- * in the string s2, ignoring case.  strcasestr() returns a pointer
- * to the located string, or a null pointer if the string is not found.
- * If s2 is empty, the function returns s1.
- */
-
-static char*
-strcasestr(const char* s1, const char* s2)
-{
-  int* cm = __trans_lower;
-  const uchar_t* us1 = (const uchar_t*)s1;
-  const uchar_t* us2 = (const uchar_t*)s2;
-  const uchar_t* tptr;
-  int c;
-
-  if (us2 == NULL || *us2 == '\0')
-    return ((char*)us1);
-
-  c = cm[*us2];
-  while (*us1 != '\0') {
-    if (c == cm[*us1++]) {
-      tptr = us1;
-      while (cm[c = *++us2] == cm[*us1++] && c != '\0')
-        continue;
-      if (c == '\0')
-        return ((char*)tptr - 1);
-      us1 = tptr;
-      us2 = (const uchar_t*)s2;
-      c = cm[*us2];
-    }
-  }
-
-  return (NULL);
-}
-
-#endif // HAVE_STRCASESTR
-
 static Json getServerDetail()
 {
   return Json::object{