From: Michael Vogt Date: Thu, 8 May 2014 09:46:29 +0000 (+0200) Subject: fix regression from commit 215b0faf X-Git-Tag: 1.0.1ubuntu2.1~6^2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/acea28d0a3a55c4df1390c42288043002610fbc9?hp=-c fix regression from commit 215b0faf --- acea28d0a3a55c4df1390c42288043002610fbc9 diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index d589c4c5a..e56deae1e 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -97,13 +97,8 @@ bool CacheDB::ReadyDB(std::string const &DB) /* */ bool CacheDB::OpenFile() { - // its open already - if(Fd && Fd->Name() == this->FileName) - return true; - - // a different file is open, close it first - if(Fd && Fd->Name() != this->FileName) - CloseFile(); + // always close existing file first + CloseFile(); // open a new file Fd = new FileFd(FileName,FileFd::ReadOnly); @@ -128,13 +123,8 @@ void CacheDB::CloseFile() // CacheDB::OpenDebFile - Open a debfile /*{{{*/ bool CacheDB::OpenDebFile() { - // debfile is already open - if(DebFile && &DebFile->GetFile() == Fd) - return true; - - // a different debfile is open, close it first - if(DebFile && &DebFile->GetFile() != Fd) - CloseDebFile(); + // always close existing file first + CloseDebFile(); // first open the fd, then pass it to the debDebFile if(OpenFile() == false)