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

Re: svn commit: rev 1677 - trunk/subversion/libsvn_wc

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-04-12 19:03:50 CEST

cmpilato@tigris.org writes:
> Author: cmpilato
> Date: 2002-04-12 03:14 GMT
> New Revision: 1677
>
> Modified:
> trunk/subversion/libsvn_wc/translate.c
> Log:
> * subversion/libsvn_wc/translate.c
> (expand_keyword): Use apr_strnatcasecmp instead of strcasecmp.

Hmmm -- what was the reason for the switch?

We're just testing to see if the strings are "the same" or not; if the
value returned by str[nat]casecmp is non-zero, we don't care if it's
negative or positive, right? The fact that it's non-zero is all that
matters. Is there some way that natural order comparison will help us
here?

-K

> Modified: trunk/subversion/libsvn_wc/translate.c
> ==============================================================================
> --- trunk/subversion/libsvn_wc/translate.c (original)
> +++ trunk/subversion/libsvn_wc/translate.c Thu Apr 11 22:14:19 2002
> @@ -897,7 +897,7 @@
> {
> *is_valid_p = TRUE;
>
> - /* Using strcasecmp() to accept downcased short versions of
> + /* Using apr_strnatcasecmp() to accept downcased short versions of
> * keywords. Note that this doesn't apply to the strings being
> * expanded in the file -- rather, it's so users can do
> *
> @@ -908,7 +908,7 @@
> */
>
> if ((! strcmp (keyword, SVN_KEYWORD_REVISION_LONG))
> - || (! strcasecmp (keyword, SVN_KEYWORD_REVISION_SHORT)))
> + || (! apr_strnatcasecmp (keyword, SVN_KEYWORD_REVISION_SHORT)))
> {
> if ((entry) && (entry->cmt_rev))
> keywords->revision = svn_string_createf (pool, "%ld", entry->cmt_rev);
> @@ -919,7 +919,7 @@
> keywords->revision = svn_string_create ("", pool);
> }
> else if ((! strcmp (keyword, SVN_KEYWORD_DATE_LONG))
> - || (! strcasecmp (keyword, SVN_KEYWORD_DATE_SHORT)))
> + || (! apr_strnatcasecmp (keyword, SVN_KEYWORD_DATE_SHORT)))
> {
> if (entry && (entry->cmt_date))
> keywords->date = svn_wc__friendly_date
> @@ -928,7 +928,7 @@
> keywords->date = svn_string_create ("", pool);
> }
> else if ((! strcmp (keyword, SVN_KEYWORD_AUTHOR_LONG))
> - || (! strcasecmp (keyword, SVN_KEYWORD_AUTHOR_SHORT)))
> + || (! apr_strnatcasecmp (keyword, SVN_KEYWORD_AUTHOR_SHORT)))
> {
> if (entry && (entry->cmt_author))
> keywords->author = svn_string_create_from_buf (entry->cmt_author, pool);
> @@ -936,7 +936,7 @@
> keywords->author = svn_string_create ("", pool);
> }
> else if ((! strcmp (keyword, SVN_KEYWORD_URL_LONG))
> - || (! strcasecmp (keyword, SVN_KEYWORD_URL_SHORT)))
> + || (! apr_strnatcasecmp (keyword, SVN_KEYWORD_URL_SHORT)))
> {
> if (entry && (entry->url))
> keywords->url = svn_string_create_from_buf (entry->url, pool);
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Apr 12 18:59:22 2002

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.