Commit f5e991c7 authored by Rafaël Carré's avatar Rafaël Carré

Remove untested strncasecmp replacement

Since it never built, it was never needed on any platform
parent e10b28cd
/*****************************************************************************
* strncasecmp.c: POSIX strncasecmp() replacement
*****************************************************************************
* Copyright © 1998-2009 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <string.h>
#include <ctype.h>
#include <assert.h>
int strncasecmp (const char *s1, const char *s2)
{
#ifdef HAVE_STRNICMP
return strnicmp (s1, s2);
#else
for (size_t i = 0; i < n; i++)
{
unsigned char c1 = s1[i], c2 = s2[i];
int d = tolower (c1) - tolower (c2);
if (d || !c1)
return d;
assert (c2);
}
return 0;
#endif
}
...@@ -492,7 +492,7 @@ need_libc=false ...@@ -492,7 +492,7 @@ need_libc=false
dnl Check for usual libc functions dnl Check for usual libc functions
AC_CHECK_DECLS([nanosleep],,,[#include <time.h>]) AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale]) AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp]) AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
AC_CHECK_FUNCS(fdatasync,, AC_CHECK_FUNCS(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.]) [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
]) ])
......
...@@ -242,7 +242,6 @@ ...@@ -242,7 +242,6 @@
#cmakedefine HAVE_STRING_H #cmakedefine HAVE_STRING_H
#cmakedefine HAVE_STRISTR #cmakedefine HAVE_STRISTR
#cmakedefine HAVE_STRLCPY #cmakedefine HAVE_STRLCPY
#cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_STRNDUP #cmakedefine HAVE_STRNDUP
#cmakedefine HAVE_STRNICMP #cmakedefine HAVE_STRNICMP
#cmakedefine HAVE_STRNLEN #cmakedefine HAVE_STRNLEN
......
...@@ -118,10 +118,6 @@ char *strcasestr (const char *, const char *); ...@@ -118,10 +118,6 @@ char *strcasestr (const char *, const char *);
char *strdup (const char *); char *strdup (const char *);
#endif #endif
#ifndef HAVE_STRNCASECMP
int strncasecmp (const char *, const char *, size_t);
#endif
#ifndef HAVE_STRVERSCMP #ifndef HAVE_STRVERSCMP
int strverscmp (const char *, const char *); int strverscmp (const char *, const char *);
#endif #endif
......
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