X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/09e712b10eafd2118db23ed9821a6f75604b9db6..4f00fb2f265f5230c7d138b52854c0886092c0ab:/apt-pkg/deb/debversion.cc?ds=sidebyside diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc index a3bb908dd..aeee61929 100644 --- a/apt-pkg/deb/debversion.cc +++ b/apt-pkg/deb/debversion.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: debversion.cc,v 1.5 2002/11/23 07:54:36 jgg Exp $ +// $Id: debversion.cc,v 1.8 2003/09/10 23:39:49 mdz Exp $ /* ###################################################################### Debian Version - Versioning system for Debian @@ -48,9 +48,15 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd, if (A >= AEnd && B >= BEnd) return 0; if (A >= AEnd) + { + if (*B == '~') return 1; return -1; + } if (B >= BEnd) + { + if (*A == '~') return -1; return 1; + } /* Iterate over the whole string What this does is to spilt the whole string into groups of @@ -63,13 +69,10 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd, const char *rhs = B; while (lhs != AEnd && rhs != BEnd) { - // Starting points - const char *Slhs = lhs; - const char *Srhs = rhs; int first_diff = 0; - while ((lhs != AEnd && !isdigit(*lhs)) || - (rhs != BEnd && !isdigit(*rhs)) ) + while (lhs != AEnd && rhs != BEnd && + (!isdigit(*lhs) || !isdigit(*rhs))) { int vc = order(*lhs); int rc = order(*rhs); @@ -104,11 +107,17 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd, // lhs is shorter if (lhs == AEnd) + { + if (*rhs == '~') return 1; return -1; + } // rhs is shorter if (rhs == BEnd) + { + if (*lhs == '~') return -1; return 1; + } // Shouldnt happen return 1;