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

Minor logic bug

From: Jeff Squyres <jsquyres_at_osl.iu.edu>
Date: 2001-12-08 00:55:23 CET

I found a minor bug in the logic that checks the version of db. It
compares each portion of the version number (major, minor, patch)
individually instead of combining them as appropriate.

Here's the code as it is now:

  if (major < SVN_FS_WANT_DB_MAJOR
      || minor < SVN_FS_WANT_DB_MINOR
      || patch < SVN_FS_WANT_DB_PATCH)

Hence, if the desired version is 4.5.6, and the actual version is 4.6.0
this test will still report false (because patch is less than 6, even
though minor is greater than 5).

This bit me when I tried to use DB 4.0.14 with SVN (yes, I know this is
probably a bad idea :-). I had to do some extra work to get SVN to
compile properly with 4.0.14 (DB's API has changed... again), but then it
failed at run time because this test thought that the minor version "0"
meant that DB's version was less than what it wanted. So it failed for
the wrong reason.

The patch is simple enough, and is attached.

{+} Jeff Squyres
{+} jsquyres@osl.iu.edu
{+} Research Associate, Open Systems Lab, Indiana University
{+} http://www.osl.iu.edu/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sat Oct 21 14:36:51 2006

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.