[vlc-commits] Remove untested strncasecmp replacement

Rafaël Carré git at videolan.org
Tue Jan 15 09:30:22 CET 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue Jan 15 09:29:33 2013 +0100| [96e1fd20ccdcb1e39e31b592d7dc9ab49a1bf5ce] | committer: Rafaël Carré

Remove untested strncasecmp replacement

Since it never built, it was never needed on any platform

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=96e1fd20ccdcb1e39e31b592d7dc9ab49a1bf5ce
---

 compat/strncasecmp.c |   44 --------------------------------------------
 configure.ac         |    2 +-
 2 files changed, 1 insertion(+), 45 deletions(-)

diff --git a/compat/strncasecmp.c b/compat/strncasecmp.c
deleted file mode 100644
index c968a7c..0000000
--- a/compat/strncasecmp.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*****************************************************************************
- * 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
-}
diff --git a/configure.ac b/configure.ac
index 566a9f1..b0639e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -492,7 +492,7 @@ need_libc=false
 dnl Check for usual libc functions
 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_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_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
 ])



More information about the vlc-commits mailing list