Wouldn't it be better to instead create the corresponding
EBCDIC table and the have ap_strcasecmp() choose which table
to use depending on APR_CHARSET_EBCDIC?

        http://www.astrodigital.org/digital/ebcdic.html

Also, we are assuming that >127 do not map to lowercase.

> On Nov 21, 2015, at 2:35 PM, [email protected] wrote:
> 
> Author: covener
> Date: Sat Nov 21 19:35:24 2015
> New Revision: 1715554
> 
> URL: http://svn.apache.org/viewvc?rev=1715554&view=rev
> Log:
> stick with underlying strcasecmp on EBCDIC builds
> 
> 
> Modified:
>    httpd/httpd/trunk/server/util.c
> 
> Modified: httpd/httpd/trunk/server/util.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1715554&r1=1715553&r2=1715554&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/util.c (original)
> +++ httpd/httpd/trunk/server/util.c Sat Nov 21 19:35:24 2015
> @@ -3172,6 +3172,7 @@ AP_DECLARE(int) ap_array_str_contains(co
>     return (ap_array_str_index(array, s, 0) >= 0);
> }
> 
> +#if !APR_CHARSET_EBCDIC
> /*
>  * Provide our own known-fast implementation of str[n]casecmp()
>  * NOTE: ASCII only!
> @@ -3238,3 +3239,14 @@ AP_DECLARE(int) ap_strncasecmp(const cha
>     }
>     return (0);
> }
> +#else
> +AP_DECLARE(int) ap_strcasecmp(const char *s1, const char *s2)
> +{
> +  return strcasecmp(s1, s2);
> +}
> +
> +AP_DECLARE(int) ap_strncasecmp(const char *s1, const char *s2, apr_size_t n)
> +{
> +  return strncasecmp(s1, s2, n);
> +}
> +#endif /*APR_CHARSET_EBCDIC*/
> 
> 

Reply via email to