Commit 45aa33a5 authored by Pekka Pessi's avatar Pekka Pessi

auth_common.c, nua_params.c: using replacement strcasestr() if !HAVE_STRCASESTR

darcs-hash:20060926091129-65a35-e653179862c0780acf5eec2d95457e701b474057.gz
parent 8ee390a7
......@@ -34,12 +34,16 @@
#include "config.h"
#include "sofia-sip/auth_common.h"
#include "sofia-sip/msg_header.h"
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include "sofia-sip/auth_common.h"
#include "sofia-sip/msg_header.h"
#if !HAVE_STRCASESTR
char *strcasestr(char const *haystack, char const *needle);
#endif
static inline int has_token(char const *qstring, char const *token);
......@@ -159,25 +163,6 @@ int auth_struct_copy(void *dst, void const *src, isize_t s_size)
return 0;
}
#if !HAVE_STRCASESTR
static inline char const *strcasestr(char const *haystack, char const *pin)
{
size_t i, m, n;
m = strlen(haystack);
n = strlen(pin);
for (i = 0; i + n <= m; i++)
if (strncasecmp(haystack + i, pin, n) == 0)
break;
if (i + n <= m)
return haystack + i;
else
return NULL;
}
#endif
static inline int has_token(char const *qstring, char const *token)
{
size_t n = strlen(token);
......
......@@ -54,6 +54,10 @@
#include <assert.h>
#if !HAVE_STRCASESTR
char *strcasestr(char const *haystack, char const *needle);
#endif
/* ====================================================================== */
/* Helper macros and functions for handling #nua_handle_preferences_t. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment