diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-07-17 15:57:10 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-07-17 15:57:10 -0700 |
commit | 822b6bffce953041accc13f4633d2c5d4a8c8dcd (patch) | |
tree | 3c6c54e12f621c3f1868f9aeabce242b1b844b85 | |
parent | d76839f34692c7bc4ad1337ca23a3362534c1172 (diff) |
Use strncasecmp if we can, instead of our own homegrown strncmp_nocase
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | handle.c | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 089720f..4216294 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,8 @@ AM_CONFIG_HEADER(config.h) AC_PROG_CC AC_PROG_INSTALL +AC_CHECK_FUNCS([strncasecmp]) + # Checks for pkg-config packages PKG_CHECK_MODULES(DEP, x11) AC_SUBST(DEP_CFLAGS) @@ -28,6 +28,7 @@ from The Open Group. */ /* $XFree86: xc/programs/xmodmap/handle.c,v 3.6 2001/07/25 15:05:27 dawes Exp $ */ +#include "config.h" #include <X11/Xos.h> #include <X11/Xlib.h> #include <stdio.h> @@ -791,8 +792,9 @@ do_clear(char *line, int len) add_to_work_queue (uop); } +#ifndef HAVE_STRNCASECMP static int -strncmp_nocase(const char *a, const char *b, int n) +strncasecmp(const char *a, const char *b, int n) { int i; int a1, b1; @@ -809,7 +811,7 @@ strncmp_nocase(const char *a, const char *b, int n) } return 0; } - +#endif /* * do_pointer = get list of numbers of the form @@ -851,7 +853,7 @@ do_pointer(char *line, int len) line += n, len -= n; i = 0; - if (len < 7 || strncmp_nocase (line, "default", 7) != 0) { + if (len < 7 || strncasecmp (line, "default", 7) != 0) { while (len > 0) { n = skip_space (line, len); line += n, len -= n; |