From: Julian Andres Klode Date: Fri, 14 Aug 2015 13:07:28 +0000 (+0200) Subject: apt-cache: Show an error if stats gets any arguments X-Git-Tag: 1.1.exp9~36 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/714c23a791971037518ccc07c497fe3c6451f82c?ds=sidebyside;hp=--cc apt-cache: Show an error if stats gets any arguments Closes: #153161 --- 714c23a791971037518ccc07c497fe3c6451f82c diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 117a44292..a03224986 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -310,10 +310,15 @@ static void ShowHashTableStats(std::string Type, // Stats - Dump some nice statistics /*{{{*/ // --------------------------------------------------------------------- /* */ -static bool Stats(CommandLine &) +static bool Stats(CommandLine &CmdL) { pkgCacheFile CacheFile; pkgCache *Cache = CacheFile.GetPkgCache(); + + if (CmdL.FileSize() > 1) { + _error->Error(_("apt-cache stats does not take any arguments")); + return false; + } if (unlikely(Cache == NULL)) return false;