summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-04-04 12:16:22 +0200
committerMichael Vogt <mvo@debian.org>2014-04-04 12:16:22 +0200
commitec4371acb7bf586b4ed274b47813e5785da6b424 (patch)
treefd40096277b18c6abc33bf3c6fc44c8ea1126930 /apt-private
parent5cfd6ef6c6ad67658c042453075e54ac23d10245 (diff)
Fix crash in "apt list" when a sources.list file is unreable
Closes: 743413
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-list.cc5
-rw-r--r--apt-private/private-list.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc
index 7664ca134..b053cbcbe 100644
--- a/apt-private/private-list.cc
+++ b/apt-private/private-list.cc
@@ -99,14 +99,13 @@ static void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records,/*{{{*/
/*}}}*/
// list - list package based on criteria /*{{{*/
// ---------------------------------------------------------------------
-bool List(CommandLine &Cmd)
+bool DoList(CommandLine &Cmd)
{
pkgCacheFile CacheFile;
pkgCache *Cache = CacheFile.GetPkgCache();
- pkgRecords records(CacheFile);
-
if (unlikely(Cache == NULL))
return false;
+ pkgRecords records(CacheFile);
const char **patterns;
const char *all_pattern[] = { "*", NULL};
diff --git a/apt-private/private-list.h b/apt-private/private-list.h
index 461f527cb..aa2677764 100644
--- a/apt-private/private-list.h
+++ b/apt-private/private-list.h
@@ -5,7 +5,7 @@
class CommandLine;
-APT_PUBLIC bool List(CommandLine &Cmd);
+APT_PUBLIC bool DoList(CommandLine &Cmd);
#endif