summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-21 15:46:52 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-21 15:46:52 -0700
commit8fa3682c14fc40a06f3af9a462301f39739a26bd (patch)
tree9ccd742df79644879a098874cd90549663e528cd
parent75ad621cfcf3c2591b7b9602bc0934d445153c6a (diff)
Assume all target platforms have strcasecmp() now
It's a standard part of Unix98/SUSv2 and later Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/app/xedit/-/merge_requests/10>
-rw-r--r--AUTHORS4
-rw-r--r--Makefile.am8
-rw-r--r--configure.ac2
-rw-r--r--lisp/lsp.c4
-rw-r--r--strcasecmp.c40
-rw-r--r--xedit.h4
6 files changed, 0 insertions, 62 deletions
diff --git a/AUTHORS b/AUTHORS
index 60c1d32..68d5561 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -137,7 +137,3 @@ standard libraries:
(Based on Copyright notice)
Constantin S. Svintsoff
realpath.c
-
-(No author information, using CVS tag)
-David Dawes <dawes@XFree86.Org>
-strcasecmp.c
diff --git a/Makefile.am b/Makefile.am
index fa30eaf..942cdb5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -125,10 +125,6 @@ if NEED_REALPATH
xedit_SOURCES += realpath.c
endif
-if NEED_STRCASECMP
-xedit_SOURCES += strcasecmp.c
-endif
-
# lisp/lsp
lisp_lsp_DEPENDENCIES = liblisp.a libre.a libmp.a
lisp_lsp_CFLAGS = $(CWARNFLAGS) -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"@LISPDIR@\" -D_BSD_SOURCE
@@ -141,10 +137,6 @@ if NEED_REALPATH
lisp_lsp_SOURCES += realpath.c
endif
-if NEED_STRCASECMP
-lisp_lsp_SOURCES += strcasecmp.c
-endif
-
# re/tests
lisp_re_tests_DEPENDENCIES = libre.a
lisp_re_tests_CFLAGS = $(CWARNFLAGS) -I$(top_srcdir)/lisp/re -D_BSD_SOURCE
diff --git a/configure.ac b/configure.ac
index 8b66bcc..869dd4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,8 +54,6 @@ AC_CHECK_FUNCS([getpagesize])
AC_CHECK_FUNC(realpath, [], [have_realpath=yes])
AM_CONDITIONAL(NEED_REALPATH, test x$have_realpath = xyes)
-AC_CHECK_FUNC(strcasecmp, [], [have_strcasecmp=yes])
-AM_CONDITIONAL(NEED_STRCASECMP, test x$have_strcasecmp = xyes)
AC_CHECK_FUNC(unsetenv, [], [have_unsetenv=yes])
AM_CONDITIONAL(NEED_UNSETENV, test x$have_unsetenv = xyes)
diff --git a/lisp/lsp.c b/lisp/lsp.c
index a945cba..5c8f6fb 100644
--- a/lisp/lsp.c
+++ b/lisp/lsp.c
@@ -33,10 +33,6 @@
#include <string.h>
#include "lisp/lisp.h"
-#ifdef NEED_STRCASECMP
-int strcasecmp(const char *s1, const char *s2);
-int strncasecmp(const char *s1, const char *s2, size_t n);
-#endif
#ifdef NEED_REALPATH
#include <sys/param.h>
char *realpath(const char *pathname, char resolvedname[MAXPATHLEN]);
diff --git a/strcasecmp.c b/strcasecmp.c
deleted file mode 100644
index 77ff4c3..0000000
--- a/strcasecmp.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $XFree86: xc/programs/xedit/strcasecmp.c,v 1.1 1999/06/14 02:38:07 dawes Exp $ */
-
-#include <ctype.h>
-#include <sys/types.h>
-
-#ifndef LISP
-#include "xedit.h"
-#endif
-
-/* Just like the BSD version. It assumes that tolower() is ANSI-compliant */
-
-int
-strcasecmp(const char *s1, const char *s2)
-{
- const unsigned char *us1 = (const unsigned char *)s1;
- const unsigned char *us2 = (const unsigned char *)s2;
-
- while (tolower(*us1) == tolower(*us2++))
- if (*us1++ == '\0')
- return 0;
- return tolower(*us1) - tolower(*--us2);
-}
-
-int
-strncasecmp(const char *s1, const char *s2, size_t n)
-{
- if (n != 0) {
- const unsigned char *us1 = (const unsigned char *)s1;
- const unsigned char *us2 = (const unsigned char *)s2;
-
- do {
- if (tolower(*us1) != tolower(*us2++))
- return tolower(*us1) - tolower(*--us2);
- if (*us1++ == '\0')
- break;
- } while (--n != 0);
- }
- return 0;
-}
-
diff --git a/xedit.h b/xedit.h
index b8d3a84..50351f1 100644
--- a/xedit.h
+++ b/xedit.h
@@ -182,10 +182,6 @@ void TagsAction(Widget, XEvent*, String*, Cardinal*);
void SearchTagsFile(xedit_flist_item *item);
/* externs for system replacement functions */
-#ifdef NEED_STRCASECMP
-int strcasecmp(const char *s1, const char *s2);
-int strncasecmp(const char *s1, const char *s2, size_t n);
-#endif
#ifdef NEED_REALPATH
#include <sys/param.h>
char *realpath(const char *pathname, char resolvedname[MAXPATHLEN]);