From 62d8a765b9b37354efab6ca838cbdb7f347f7cac Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jan 2014 19:51:23 +0100 Subject: rework some code to fix some scan-build warnings No visible functional changes, just code moved around and additional checks to eliminate impossible branches Reported-By: scan-build Git-Dch: Ignore --- apt-pkg/aptconfiguration.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/aptconfiguration.cc') diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 115d11616..1ebcf97bc 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -141,7 +141,7 @@ std::vector const Configuration::getLanguages(bool const &All, // so they will be all included in the Cache. std::vector builtin; DIR *D = opendir(_config->FindDir("Dir::State::lists").c_str()); - if (D != 0) { + if (D != NULL) { builtin.push_back("none"); for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D)) { string const name = SubstVar(Ent->d_name, "%5f", "_"); @@ -166,8 +166,8 @@ std::vector const Configuration::getLanguages(bool const &All, continue; builtin.push_back(c); } + closedir(D); } - closedir(D); // FIXME: Remove support for the old APT::Acquire::Translation // it was undocumented and so it should be not very widthly used -- cgit v1.2.3