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

RE: Re: Re: RE: Repobrowser - Numeric order filename sorting

From: Gerasimov, Ivan <Ivan.Gerasimov_at_transas.com>
Date: 2006-04-11 13:29:56 CEST

Hello, Stefan!

> > > But, it still will be wrong for strings like
> > > v1.3.2
> > > v1.7.8
> > > because you stop at the first '.' char.
> > > You cold try using the atol() function, but that will also only work
> > > with one '.' char (or ',', depending on the locale), not two or three.
> >
> > It doesn't stop at the first '.'
> > And the function will handle v1.3.2, v1.7.8 and alike correctly.
> > Just check it carefully :-)
>
> Well, the '.' isn't an alpha char, but it's not a numeric char either.
> So it will stop there.
> At least it will on my system, because the '.' is not the decimal
> separator. But of course, since the project is kept english, the dot
> is used for the tag names.

The routine will eat leading characters from both strings up to the first distinguishing character. Remaining strings will be then "3.2" and "7.8". Since both strings start with digits, the routine will try to parse them and will come up with "3" and "7". 3 is less than 7. That's it.

I used the clause (IsCharAlphaNumeric(ch) && !IsCharAlpha(ch)) only as synonym for 'isdigit' function. For some reason the function IsCharNumeric() is missing from Win API. I did not assume anywhere that dot is alpha-numeric.

Sincerely yours,
Ivan Gerasimov

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Tue Apr 11 13:30:22 2006

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

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