mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-05 04:53:13 +02:00
Yes, strcasecmp is always available, configure.
This commit is contained in:
@@ -5883,19 +5883,6 @@ $as_echo "#define HAVE_EXPLICIT_BZERO /**/" >>confdefs.h
|
||||
fi
|
||||
done
|
||||
|
||||
for ac_func in strcasecmp
|
||||
do :
|
||||
ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
|
||||
if test "x$ac_cv_func_strcasecmp" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_STRCASECMP 1
|
||||
_ACEOF
|
||||
|
||||
$as_echo "#define GOT_STRCASECMP /**/" >>confdefs.h
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
for ac_func in syslog
|
||||
do :
|
||||
ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
|
||||
|
||||
@@ -359,7 +359,6 @@ AC_CHECK_FUNCS(strtok,,AC_DEFINE([NEED_STRTOK], [], [Define if you need the strt
|
||||
AC_CHECK_FUNCS(strerror,,AC_DEFINE([NEED_STRERROR], [], [Define if you need the strerror function.]))
|
||||
AC_CHECK_FUNCS(strtoul,,STRTOUL="strtoul.o")
|
||||
AC_CHECK_FUNCS(explicit_bzero,AC_DEFINE([HAVE_EXPLICIT_BZERO], [], [Define if you have explicit_bzero]))
|
||||
AC_CHECK_FUNCS(strcasecmp,AC_DEFINE([GOT_STRCASECMP], [], [Define if you have strcasecmp]))
|
||||
AC_CHECK_FUNCS(syslog,AC_DEFINE([HAVE_SYSLOG], [], [Define if you have syslog]))
|
||||
AC_SUBST(STRTOUL)
|
||||
AC_SUBST(CRYPTOLIB)
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
/* OMG... OMG! WHAT AN INCLUDE HORROR !!! */
|
||||
#undef strcasecmp
|
||||
#undef strncasecmp
|
||||
#include <ares.h>
|
||||
#include <ares_version.h>
|
||||
#undef strcasecmp
|
||||
#undef strncasecmp
|
||||
#ifndef GOT_STRCASECMP
|
||||
#define strcasecmp mycmp
|
||||
#define strncasecmp myncmp
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
typedef enum {
|
||||
DNSREQ_CLIENT = 1,
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
/* Define if you have the <glob.h> header file. */
|
||||
#undef GLOBH
|
||||
|
||||
/* Define if you have strcasecmp */
|
||||
#undef GOT_STRCASECMP
|
||||
|
||||
/* Define if ssl library has SSL_CTX_set1_curves_list */
|
||||
#undef HAS_SSL_CTX_SET1_CURVES_LIST
|
||||
|
||||
@@ -97,9 +94,6 @@
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `strcasecmp' function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define to 1 if you have the `strerror' function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
|
||||
@@ -65,10 +65,6 @@
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
#ifndef GOT_STRCASECMP
|
||||
#define strcasecmp mycmp
|
||||
#define strncasecmp myncmp
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <sys/time.h>
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#define PREFIX_AQ
|
||||
#define LIST_SHOW_MODES
|
||||
#ifndef mode_t
|
||||
#define GOT_STRCASECMP
|
||||
#define strcasecmp _strcasecmp
|
||||
#define strncasecmp _strncasecmp
|
||||
#define HAVE_EXPLICIT_BZERO
|
||||
|
||||
+1
-2
@@ -49,7 +49,6 @@ ID_Copyright("(C) Tony Vincell");
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#define BadPtr(x) (!(x) || (*(x) == '\0'))
|
||||
#define mycmp strcasecmp
|
||||
#endif
|
||||
|
||||
#if defined(CR_DEBUG) || defined(CR_CHKCONF)
|
||||
@@ -562,7 +561,7 @@ int crule_parsefunction(crule_treeptr *funcrootp, int *next_tokp, char **rulept
|
||||
{
|
||||
for (funcnum = 0;; funcnum++)
|
||||
{
|
||||
if (mycmp(crule_funclist[funcnum].name, funcname) == 0)
|
||||
if (strcasecmp(crule_funclist[funcnum].name, funcname) == 0)
|
||||
break;
|
||||
if (crule_funclist[funcnum].name[0] == '\0')
|
||||
return (CR_UNKNWFUNC);
|
||||
|
||||
+6
-25
@@ -203,10 +203,12 @@ char *collapse(char *pattern)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Case insensitive comparison of two NULL terminated strings.
|
||||
*
|
||||
* returns 0, if s1 equal to s2
|
||||
/* Case insensitive comparison of two NULL terminated strings,
|
||||
* using the "IRC nick comparisson" rules. Or, well, partially
|
||||
* anyway.
|
||||
* Should be used for NICK-related comparissons. And probably
|
||||
* not even then, since this does not deal with multibyte.
|
||||
* @returns 0, if s1 equal to s2
|
||||
* <0, if s1 lexicographically less than s2
|
||||
* >0, if s1 lexicographically greater than s2
|
||||
*/
|
||||
@@ -229,27 +231,6 @@ int smycmp(const char *s1, const char *s2)
|
||||
return (res);
|
||||
}
|
||||
|
||||
|
||||
int myncmp(const char *str1, const char *str2, int n)
|
||||
{
|
||||
u_char *s1;
|
||||
u_char *s2;
|
||||
int res;
|
||||
|
||||
s1 = (u_char *)str1;
|
||||
s2 = (u_char *)str2;
|
||||
|
||||
while ((res = toupper(*s1) - toupper(*s2)) == 0)
|
||||
{
|
||||
s1++;
|
||||
s2++;
|
||||
n--;
|
||||
if (n == 0 || (*s1 == '\0' && *s2 == '\0'))
|
||||
return 0;
|
||||
}
|
||||
return (res);
|
||||
}
|
||||
|
||||
u_char tolowertab[] = {
|
||||
0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
|
||||
0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
|
||||
|
||||
@@ -133,7 +133,7 @@ CMD_FUNC(m_dccallow)
|
||||
}
|
||||
del_dccallow(sptr, acptr);
|
||||
} else
|
||||
if (!didlist && !myncmp(s, "list", 4))
|
||||
if (!didlist && !strncasecmp(s, "list", 4))
|
||||
{
|
||||
didanything = didlist = 1;
|
||||
sendnumericfmt(sptr, RPL_DCCINFO, "The following users are on your dcc allow list:");
|
||||
@@ -147,7 +147,7 @@ CMD_FUNC(m_dccallow)
|
||||
}
|
||||
sendnumeric(sptr, RPL_ENDOFDCCLIST, s);
|
||||
} else
|
||||
if (!didhelp && !myncmp(s, "help", 4))
|
||||
if (!didhelp && !strncasecmp(s, "help", 4))
|
||||
{
|
||||
didanything = didhelp = 1;
|
||||
for(ptr = dcc_help; *ptr; ptr++)
|
||||
|
||||
@@ -581,9 +581,9 @@ int size_string, ret;
|
||||
|
||||
ctcp = &text[1];
|
||||
/* Most likely a DCC send .. */
|
||||
if (!myncmp(ctcp, "DCC SEND ", 9))
|
||||
if (!strncasecmp(ctcp, "DCC SEND ", 9))
|
||||
ctcp = text + 10;
|
||||
else if (!myncmp(ctcp, "DCC RESUME ", 11))
|
||||
else if (!strncasecmp(ctcp, "DCC RESUME ", 11))
|
||||
ctcp = text + 12;
|
||||
else
|
||||
return 1; /* something else, allow */
|
||||
@@ -660,7 +660,7 @@ int size_string;
|
||||
|
||||
ctcp = &text[1];
|
||||
/* Most likely a DCC send .. */
|
||||
if (!myncmp(ctcp, "DCC SEND ", 9))
|
||||
if (!strncasecmp(ctcp, "DCC SEND ", 9))
|
||||
ctcp = text + 10;
|
||||
else
|
||||
return 1; /* something else, allow */
|
||||
|
||||
Reference in New Issue
Block a user