aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-02-02 23:18:08 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-02-02 23:18:08 +0000
commit65d08be0ec6876664f7e205fc311043f5fa8c7fd (patch)
treea70e94ae9fc66c11aa471803c80f32fca3bf6414
parent9f496dd5300d95cb31eaeed085168e7a493b458a (diff)
downloadpaludis-65d08be0ec6876664f7e205fc311043f5fa8c7fd.tar.gz
paludis-65d08be0ec6876664f7e205fc311043f5fa8c7fd.tar.xz
(from ciaranm) Fix segfault in adjutrix --reverse-deps.
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index 57a74bb..5ef4ea3 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -45,7 +45,7 @@ namespace
{
private:
std::tr1::shared_ptr<const PackageDatabase> _db;
- std::tr1::shared_ptr<const PackageDatabaseEntryCollection> _entries;
+ const PackageDatabaseEntryCollection & _entries;
std::string _depname;
std::string _p;
@@ -58,7 +58,8 @@ namespace
public:
using DepAtomVisitorTypes::ConstVisitor::VisitChildren<ReverseDepChecker, AllDepAtom>::visit;
- ReverseDepChecker(std::tr1::shared_ptr<const PackageDatabase> db, std::tr1::shared_ptr<const PackageDatabaseEntryCollection> entries,
+ ReverseDepChecker(std::tr1::shared_ptr<const PackageDatabase> db,
+ const PackageDatabaseEntryCollection & entries,
const std::string & p) :
_db(db),
_entries(entries),
@@ -124,7 +125,7 @@ namespace
for (PackageDatabaseEntryCollection::Iterator e(dep_entries->begin()), e_end(dep_entries->end()) ;
e != e_end ; ++e)
{
- if (_entries->find(*e) != _entries->end())
+ if (_entries.find(*e) != _entries.end())
{
_found_matches |= true;
@@ -186,7 +187,7 @@ namespace
try
{
std::tr1::shared_ptr<const VersionMetadata> metadata(r.version_metadata(e->name, e->version));
- ReverseDepChecker checker(env.package_database(), std::tr1::shared_ptr<const PackageDatabaseEntryCollection>(&entries),
+ ReverseDepChecker checker(env.package_database(), entries,
stringify(p) + "-" + stringify(e->version));
if (metadata->deps_interface)