]> git.saurik.com Git - apt.git/commitdiff
apt-cache: Show an error if stats gets any arguments
authorJulian Andres Klode <jak@debian.org>
Fri, 14 Aug 2015 13:07:28 +0000 (15:07 +0200)
committerJulian Andres Klode <jak@debian.org>
Fri, 14 Aug 2015 13:07:28 +0000 (15:07 +0200)
Closes: #153161
cmdline/apt-cache.cc

index 117a4429235c07aad383f6ec692086b0c2a806a8..a0322498652954073f2ba4cc410af21c879ecdaf 100644 (file)
@@ -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;