]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debindexfile.cc
add support for Build-Depends/Conflicts-Arch
[apt.git] / apt-pkg / deb / debindexfile.cc
index 6a23b2c00ae57b96881857110f6df6a756abee1f..c55847305ff96c4038c64eae425a6b173f0d28e2 100644 (file)
@@ -30,6 +30,7 @@
 #include <sstream>
 
 #include <sys/stat.h>
+#include <unistd.h>
                                                                        /*}}}*/
 
 // Sources Index                                                       /*{{{*/
@@ -80,7 +81,11 @@ debPackagesIndex::debPackagesIndex(IndexTarget const &Target, bool const Trusted
 std::string debPackagesIndex::ArchiveInfo(pkgCache::VerIterator const &Ver) const
 {
    std::string Res = Target.Description;
-   Res.erase(Target.Description.rfind(' '));
+   {
+      auto const space = Target.Description.rfind(' ');
+      if (space != std::string::npos)
+        Res.erase(space);
+   }
 
    Res += " ";
    Res += Ver.ParentPkg().Name();