summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/deblistparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb/deblistparser.cc')
-rw-r--r--apt-pkg/deb/deblistparser.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index a36857cb5..28568d5e3 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -522,9 +522,9 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
// Skip whitespace
for (;I != Stop && isspace(*I) != 0; I++);
Start = I;
- for (;I != Stop && *I != ')'; I++);
- if (I == Stop || Start == I)
- return 0;
+ I = (const char*) memchr(I, ')', Stop - I);
+ if (I == NULL || Start == I)
+ return 0;
// Skip trailing whitespace
const char *End = I;
@@ -675,6 +675,9 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver)
return _error->Error("Problem parsing Provides line");
if (Op != pkgCache::Dep::NoOp) {
_error->Warning("Ignoring Provides line with DepCompareOp for package %s", Package.c_str());
+ } else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) {
+ if (NewProvidesAllArch(Ver, Package, Version) == false)
+ return false;
} else {
if (NewProvides(Ver, Package, Arch, Version) == false)
return false;
@@ -797,21 +800,16 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
}
// seperate the tag from the data
- for (; buffer[len] != ':' && buffer[len] != '\0'; ++len)
- /* nothing */
- ;
- if (buffer[len] == '\0')
+ const char* dataStart = strchr(buffer + len, ':');
+ if (dataStart == NULL)
continue;
- char* dataStart = buffer + len;
+ len = dataStart - buffer;
for (++dataStart; *dataStart == ' '; ++dataStart)
/* nothing */
;
- char* dataEnd = dataStart;
- for (++dataEnd; *dataEnd != '\0'; ++dataEnd)
- /* nothing */
- ;
+ const char* dataEnd = (const char*)rawmemchr(dataStart, '\0');
// The last char should be a newline, but we can never be sure: #633350
- char* lineEnd = dataEnd;
+ const char* lineEnd = dataEnd;
for (--lineEnd; *lineEnd == '\r' || *lineEnd == '\n'; --lineEnd)
/* nothing */
;