X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/9373b9752db017bc8458720f330dc9594ac8de17..af7a92c35accda98b667ff41f62ea500fca95a7c:/apt-pkg/deb/debversion.cc?ds=sidebyside diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc index 064d8fa5b..755ffbe96 100644 --- a/apt-pkg/deb/debversion.cc +++ b/apt-pkg/deb/debversion.cc @@ -11,9 +11,6 @@ /*}}}*/ // Include Files /*{{{*/ #define APT_COMPATIBILITY 986 -#ifdef __GNUG__ -#pragma implementation "apt-pkg/debversion.h" -#endif #include #include @@ -193,8 +190,22 @@ int debVersioningSystem::DoCmpVersion(const char *A,const char *AEnd, dlhs++; if (drhs != rhs) drhs++; - - return CmpFragment(dlhs,AEnd,drhs,BEnd); + + // no debian revision need to be treated like -0 + if (*(dlhs-1) == '-' && *(drhs-1) == '-') + return CmpFragment(dlhs,AEnd,drhs,BEnd); + else if (*(dlhs-1) == '-') + { + const char* null = "0"; + return CmpFragment(dlhs,AEnd,null, null+1); + } + else if (*(drhs-1) == '-') + { + const char* null = "0"; + return CmpFragment(null, null+1, drhs, BEnd); + } + else + return 0; } /*}}}*/ // debVS::CheckDep - Check a single dependency /*{{{*/