[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: apr_strnatcasecmp vs. strcasecmp

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-02-15 22:57:28 CET

Paul Burba wrote:
>
> A quick question: Is there some reason we use (with one exception in
> config.c) strcasecmp() instead of apr_strnatcasecmp()?

Yes: in every call site, we just want to know whether two strings are equal
(ignoring case). APR doesn't appear to document what a "natural order
comparison" means, but looking at the implementation it appears to mean
something like leading spaces are ignored and a run of digits is compared as a
number rather than as characters. Without the semantics being documented I
would not want to use apr_strnat[case]cmp().

I think our one use of apr_strnatcasecmp is probably a mistake, or at least not
a particularly good idea.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Feb 15 23:11:55 2006

This is an archived mail posted to the Subversion Dev mailing list.