diff options
author | bubulle@debian.org <> | 2006-05-10 20:27:12 +0200 |
---|---|---|
committer | bubulle@debian.org <> | 2006-05-10 20:27:12 +0200 |
commit | fa7733bcf513215a5e8cbd6d9be3d867444b5f1e (patch) | |
tree | daf6265a900f471c65c411b89e195808228ab90e /apt-pkg/deb/debversion.cc | |
parent | 7bbc5183958e2cb5989a45ba3bf04eacd07c6534 (diff) | |
parent | 41ca14b3108dbb7b01d1adceee857b52bc955bd5 (diff) |
Sync with Michael
Diffstat (limited to 'apt-pkg/deb/debversion.cc')
-rw-r--r-- | apt-pkg/deb/debversion.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc index aeee61929..064d8fa5b 100644 --- a/apt-pkg/deb/debversion.cc +++ b/apt-pkg/deb/debversion.cc @@ -59,7 +59,7 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd, } /* Iterate over the whole string - What this does is to spilt the whole string into groups of + What this does is to split the whole string into groups of numeric and non numeric portions. For instance: a67bhgs89 Has 4 portions 'a', '67', 'bhgs', '89'. A more normal: @@ -140,6 +140,27 @@ int debVersioningSystem::DoCmpVersion(const char *A,const char *AEnd, if (rhs == BEnd) rhs = B; + // Special case: a zero epoch is the same as no epoch, + // so remove it. + if (lhs != A) + { + for (; *A == '0'; ++A); + if (A == lhs) + { + ++A; + ++lhs; + } + } + if (rhs != B) + { + for (; *B == '0'; ++B); + if (B == rhs) + { + ++B; + ++rhs; + } + } + // Compare the epoch int Res = CmpFragment(A,lhs,B,rhs); if (Res != 0) |