diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-08-27 19:18:34 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-08-27 19:18:34 +0300 |
commit | ff28c07f95ff2400eb0ad1becc0eae1eab9dc93d (patch) | |
tree | c7be1aedb1c0dbd1cd1d78a7d0704a013a064855 | |
parent | a5847cb0a97b093cd0f23b65c72370af836c9748 (diff) | |
download | egawk-ff28c07f95ff2400eb0ad1becc0eae1eab9dc93d.tar.gz egawk-ff28c07f95ff2400eb0ad1becc0eae1eab9dc93d.tar.bz2 egawk-ff28c07f95ff2400eb0ad1becc0eae1eab9dc93d.zip |
Cleanup code for strcasecmp.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | configh.in | 3 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | regcomp.c | 11 | ||||
-rw-r--r-- | replace.c | 2 |
6 files changed, 13 insertions, 14 deletions
@@ -1,3 +1,10 @@ +2014-08-27 Arnold D. Robbins <arnold@skeeve.com> + + * configure.ac: Add test for strcasecmp. + * regcomp.c: Remove special case code around use of strcasecmp(). + * replace.c: Include missing/strncasecmp.c if either strcasecmp() + or strncasecmp() aren't available. + 2014-08-26 Arnold D. Robbins <arnold@skeeve.com> * regcomp.c, regex_internal.c: Sync with GBLIC. Why not. @@ -195,6 +195,9 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR @@ -10007,7 +10007,7 @@ for ac_func in atexit btowc fmod getgrent getgroups grantpt \ isascii iswctype iswlower iswupper mbrlen \ memcmp memcpy memcpy_ulong memmove memset \ memset_ulong mkstemp posix_openpt setenv setlocale setsid snprintf strchr \ - strerror strftime strncasecmp strcoll strtod strtoul \ + strerror strftime strcasecmp strncasecmp strcoll strtod strtoul \ system tmpfile towlower towupper tzset usleep wcrtomb \ wcscoll wctype do : diff --git a/configure.ac b/configure.ac index b0817ba3..5ad3b564 100644 --- a/configure.ac +++ b/configure.ac @@ -275,7 +275,7 @@ AC_CHECK_FUNCS(atexit btowc fmod getgrent getgroups grantpt \ isascii iswctype iswlower iswupper mbrlen \ memcmp memcpy memcpy_ulong memmove memset \ memset_ulong mkstemp posix_openpt setenv setlocale setsid snprintf strchr \ - strerror strftime strncasecmp strcoll strtod strtoul \ + strerror strftime strcasecmp strncasecmp strcoll strtod strtoul \ system tmpfile towlower towupper tzset usleep wcrtomb \ wcscoll wctype) dnl this check is for both mbrtowc and the mbstate_t type, which is good @@ -907,24 +907,13 @@ init_dfa (re_dfa_t *dfa, size_t pat_len) codeset_name = strchr (codeset_name, '.') + 1; # endif - /* strcasecmp isn't a standard interface. brute force check */ -#ifndef GAWK if (strcasecmp (codeset_name, "UTF-8") == 0 || strcasecmp (codeset_name, "UTF8") == 0) dfa->is_utf8 = 1; -#else - if ( (codeset_name[0] == 'U' || codeset_name[0] == 'u') - && (codeset_name[1] == 'T' || codeset_name[1] == 't') - && (codeset_name[2] == 'F' || codeset_name[2] == 'f') - && (codeset_name[3] == '-' - ? codeset_name[4] == '8' && codeset_name[5] == '\0' - : codeset_name[3] == '8' && codeset_name[4] == '\0')) - dfa->is_utf8 = 1; #if defined(GAWK) && defined(LIBC_IS_BORKED) if (gawk_mb_cur_max == 1) dfa->is_utf8 = 0; #endif /* defined(GAWK) && defined(LIBC_IS_BORKED) */ -#endif /* We check exhaustively in the loop below if this charset is a superset of ASCII. */ @@ -50,7 +50,7 @@ #include "missing_d/memmove.c" #endif /* HAVE_MEMMOVE */ -#ifndef HAVE_STRNCASECMP +#if !defined(HAVE_STRNCASECMP) || !defined(HAVE_STRCASECMP) #include "missing_d/strncasecmp.c" #endif /* HAVE_STRCASE */ |