]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debsrcrecords.cc
Merge commit 'e2073b0276226b625897ef475f225bf8f508719e' as 'triehash'
[apt.git] / apt-pkg / deb / debsrcrecords.cc
index 5454d79c3de9164f0a7d12f842fa69840f7581c6..5f0a75cd956019960f35138b04172ac11ebdb081 100644 (file)
@@ -73,9 +73,12 @@ const char **debSrcRecordParser::Binaries()
    char* bin = Buffer;
    do {
       char* binStartNext = strchrnul(bin, ',');
-      char* binEnd = binStartNext - 1;
-      for (; isspace_ascii(*binEnd) != 0; --binEnd)
-        binEnd = 0;
+      // Found a comma, clean up any space before it
+      if (binStartNext > Buffer) {
+        char* binEnd = binStartNext - 1;
+        for (; binEnd > Buffer && isspace_ascii(*binEnd) != 0; --binEnd)
+           *binEnd = 0;
+      }
       StaticBinList.push_back(bin);
       if (*binStartNext != ',')
         break;
@@ -100,14 +103,16 @@ bool debSrcRecordParser::BuildDepends(std::vector<pkgSrcRecords::Parser::BuildDe
    unsigned int I;
    const char *Start, *Stop;
    BuildDepRec rec;
-   const char *fields[] = {"Build-Depends", 
+   const char *fields[] = {"Build-Depends",
                            "Build-Depends-Indep",
                           "Build-Conflicts",
-                          "Build-Conflicts-Indep"};
+                          "Build-Conflicts-Indep",
+                          "Build-Depends-Arch",
+                          "Build-Conflicts-Arch"};
 
    BuildDeps.clear();
 
-   for (I = 0; I < 4; I++) 
+   for (I = 0; I < 6; I++)
    {
       if (ArchOnly && (I == 1 || I == 3))
          continue;