summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/debversion.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-07-03 18:33:31 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-07-03 18:33:31 +0200
commitb7952f4b67d7021dc912aed5f38bc45f03bfc064 (patch)
tree5d18c4268786a05df634be6dbf3a68a2d0f282b6 /apt-pkg/deb/debversion.cc
parentc833c7a16381c383588265bbb35ed24ad383b53f (diff)
parentc64d1644ae0fd1af92c80a91a6c17b57f0b8f313 (diff)
* merged with apts mainline
Diffstat (limited to 'apt-pkg/deb/debversion.cc')
-rw-r--r--apt-pkg/deb/debversion.cc23
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)