You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2015/11/21 20:35:24 UTC
svn commit: r1715554 - /httpd/httpd/trunk/server/util.c
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*/
Re: svn commit: r1715554 - /httpd/httpd/trunk/server/util.c
Posted by Eric Covener <co...@gmail.com>.
On Sun, Nov 22, 2015 at 10:33 AM, William A Rowe Jr <wr...@rowe-clan.net> wrote:
> Have a look at r1715632 and let me know what you think.
I was concered about sorting but saw that's already not totally kosher
for !APR_CHARSET_EBCDIC
from your earlier comments. I am +1 to making them used (named) for
equality tests only to
avoid subtle problems down the road.
Re: svn commit: r1715554 - /httpd/httpd/trunk/server/util.c
Posted by Jim Jagielski <ji...@jaguNET.com>.
++1
> On Nov 22, 2015, at 10:33 AM, William A Rowe Jr <wr...@rowe-clan.net> wrote:
>
> On Sat, Nov 21, 2015 at 5:10 PM, Eric Covener <co...@gmail.com> wrote:
> On Sat, Nov 21, 2015 at 5:47 PM, William A Rowe Jr <wr...@rowe-clan.net> wrote:
> > I suggest this is wrong, and that the appropriate table should be built.
> >
> > EBCDIC platforms do have i18n (typicially single-byte) lower/upper
> > equivalences, and the underlying implementation should not be trusted for
> > straight ASCII token case insensitive comparisons.
>
> I don't see it why it shouldn't be trusted, but I've reverted for now,
>
> I'll revisit when this settles down / the function is used somewhere.
>
> Have a look at r1715632 and let me know what you think.
>
> I see a lot of ill-defined or otherwise vague string functions, many of them
> are somewhat duplicate in nature, several of them questionable (unbounded
> recursion, really?) It is probably time to move these all out to util_strings.c
> and really evaluate which are appropriate to use in which contexts, while
> others should probably be evicted from trunk. ap_strcmp_match looks like
> the first worst offender (apr_fnmatch is already a much safer implementation.)
>
>
>
Re: svn commit: r1715554 - /httpd/httpd/trunk/server/util.c
Posted by William A Rowe Jr <wr...@rowe-clan.net>.
On Sat, Nov 21, 2015 at 5:10 PM, Eric Covener <co...@gmail.com> wrote:
> On Sat, Nov 21, 2015 at 5:47 PM, William A Rowe Jr <wr...@rowe-clan.net>
> wrote:
> > I suggest this is wrong, and that the appropriate table should be built.
> >
> > EBCDIC platforms do have i18n (typicially single-byte) lower/upper
> > equivalences, and the underlying implementation should not be trusted for
> > straight ASCII token case insensitive comparisons.
>
> I don't see it why it shouldn't be trusted, but I've reverted for now,
>
> I'll revisit when this settles down / the function is used somewhere.
>
Have a look at r1715632 and let me know what you think.
I see a lot of ill-defined or otherwise vague string functions, many of them
are somewhat duplicate in nature, several of them questionable (unbounded
recursion, really?) It is probably time to move these all out to
util_strings.c
and really evaluate which are appropriate to use in which contexts, while
others should probably be evicted from trunk. ap_strcmp_match looks like
the first worst offender (apr_fnmatch is already a much safer
implementation.)
Re: svn commit: r1715554 - /httpd/httpd/trunk/server/util.c
Posted by Eric Covener <co...@gmail.com>.
On Sat, Nov 21, 2015 at 5:47 PM, William A Rowe Jr <wr...@rowe-clan.net> wrote:
> I suggest this is wrong, and that the appropriate table should be built.
>
> EBCDIC platforms do have i18n (typicially single-byte) lower/upper
> equivalences, and the underlying implementation should not be trusted for
> straight ASCII token case insensitive comparisons.
I don't see it why it shouldn't be trusted, but I've reverted for now,
I'll revisit when this settles down / the function is used somewhere.
Re: svn commit: r1715554 - /httpd/httpd/trunk/server/util.c
Posted by William A Rowe Jr <wr...@rowe-clan.net>.
I suggest this is wrong, and that the appropriate table should be built.
EBCDIC platforms do have i18n (typicially single-byte) lower/upper
equivalences, and the underlying implementation should not be trusted for
straight ASCII token case insensitive comparisons.
On Sat, Nov 21, 2015 at 1:35 PM, <co...@apache.org> 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*/
>
>
>
Re: svn commit: r1715554 - /httpd/httpd/trunk/server/util.c
Posted by Jim Jagielski <ji...@jaguNET.com>.
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, covener@apache.org 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*/
>
>